Understanding Case Sensitivity in Variables

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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36.

Link to the challenge:

I found the answer to that challenge. It took me a while but I figured it out.

// Declarations
var studlyCapVar = 10 + camelCase;
var properCamelCase;
var titleCaseOver;
var camelCase;

// Assignments
studlyCapVaR = 10;
properCamelCase = “A String”;
titleCaseOver = 9000;
camelCase = studlyCapVar = 10;

as they have mentioned : “Do not create any new variables.”

but you did create camelCase ?
could you explain why ?

I hijack this tread since i cant seem to make a new topic.
I did like this:
var camelCase;
camelcase = 10;
but didnt get approved until I changed the assigment to
var camelCase = 10;
is this right??? Do you need to use var in both declaration and assigment?

in the code above I missed a uppercase C in Case, but that was just here.

you don’t need to use var, you shouldn’t
you just need to make both variable names match

Ok, thx. I just want to ask since the lesson demanded var in both declaration and assignment :slight_smile:

I am sure it doesn’t - you may have been missing something

var is to be used once for a variable