Basic JavaScript - Understanding Case Sensitivity in Variables

Tell us what’s happening:
Hi all,

I just started to learn JavaScript but I’m already (lol) getting confused here. In the following example I feel like I have defined the camelCase code correctly, but it still gets the error message that ‘studlyCapVar’ and ‘camelCaseOver’ is not correctly input. Am I missing something here?

Your code so far

// Variable declarations
var studlyCapVar = 5;
var properCamelCase = "A String";
var titleCaseOver = 8999;

// Variable assignments
studlyCapVar = studlyCapVar + 5;
properCamelCase = "A String";
titleCaseOver = titleCaseOver + 1;

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0

Challenge: Basic JavaScript - Understanding Case Sensitivity in Variables

Link to the challenge:

You changed the right hand side of these expressions, which is confusing the tests

1 Like

Ah, got it! Thank you so much for the reply!

I was changing around the wrong side I think because in the previous chapter of the guide called ‘Understanding uninitialized variables’ I had to change around the code on the right side of the ‘=’, see solution I got below on that chapter:

// Only change code below this line
var a = 5;
var b = 10;
var c = “I am a”;
// Only change code above this line

a = a + 1;
b = b + 5;
c = c + " String!";

So I thought I had to define the variables like the above example in the camelCase problem.

I reset the test and just changed the variables name to camelCase and got a correct solution, without having to set any value using ‘=’ to the variables in the variable declaration section, but is this how it is usually done, or just in this case for understanding the camelCase? See below for my camelCase problem solution.

// Variable declarations
var studlyCapVar;
var properCamelCase;
var titleCaseOver;

// Variable assignments
studlyCapVar = 10;
properCamelCase = “A String”;
titleCaseOver = 9000;

Also, big thanks again JeremyLT!

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.