Case Sensitivity in Variables

Case Sensitivity in Variables
0

#1

Tell us what’s happening:

Your code so far

// Declarations
var StUdLyCapVaR;
var properCamelCase;
var TitleCaseOver;

// Assignments
STUDLYCAPVAR = 10;
PRoperCAmelCAse = "A String";
tITLEcASEoVER = 9000;

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Safari/604.1.38.

Link to the challenge:


#2

You did not include an answer to “Tell us what’s happening”. What have you tried? What isn’t working as expected? What tests are failing? What don’t you understand? What do you understand?


#3

@shatakshi-shukla

I am going to take a stab at this and say you don’t understand what is wrong.

The capitalization and spelling during declaration sets the variable name “in stone”.
If the assignment is different, then they are unrecognized and will throw an error.

For example:

// declaration
var littleJon;

// assignment
LittleJon = 12;

Will throw an error. You notice the lower case “l” in the declaration but the uppercase “L” in the assignment?
The assignment is going to try and find the pointer to the variable, that pointer doesn’t exist.

In programming syntax you MUST be very specific and very detailed.

Back to your challenge. Be sure that any variable that is in use matches your declaration of the variable.
To the system compiler is is like calling someone by the wrong name. “tom” will not respond to “tim”, well in Javascript “tom” won’t respond to “Tom” either because JS is case sensitive.

Cheers,
-WWC