Skip to content

Peterfrontenddev1/Understanding-Case-Sensitivity-in-Variables

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 

Repository files navigation

Understanding-Case-Sensitivity-in-Variables

JavaScript in camelCase

In JavaScript all variables and function names are case sensitive. This means that capitalization matters.

MYVAR is not the same as MyVar nor myvar. It is possible to have multiple distinct variables with the same name but different casing. It is strongly recommended that for the sake of clarity, you do not use this language feature.

Best Practice

Write variable names in JavaScript in camelCase. In camelCase, multi-word variable names have the first word in lowercase and the first letter of each subsequent word is capitalized.

                                                     Examples:

                    var someVariable;
                    var anotherVariableName;
                    var thisVariableNameIsSoLong;


                                                    QUESTION

Modify the existing declarations and assignments so their names use camelCase.

Do not create any new variables.

// Variable declarations var StUdLyCapVaR; var properCamelCase; var TitleCaseOver;

// Variable assignments STUDLYCAPVAR = 10; PRoperCAmelCAse = "A String"; tITLEcASEoVER = 9000;

                                                ANSWER
   / Variable declarations

var studlyCapVar; var properCamelCase; var titleCaseOver;

// Variable assignments

studlyCapVar = 10; properCamelCase = "A String"; titleCaseOver = "9000";

About

JavaScript in camelCase

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published