## Basic JavaScript: Understanding Case Sensitivity in Variables

Basic JavaScript: Understanding Case Sensitivity in Variables

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;

What’s your question here?
Have you tried solving the challenge?
What have you tried to do?

I tried modifying various letters with different cases.

// Declarations

var StUdLyCapVaR;

var properCamelCase;

var TitleCaseOver;

// Assignments

StudyCapvar = 10;

ProperCAmelCAse = “A String”;

TitlecASEoVER = 9000;

Modify the existing declarations and assignments so their names use camelCase.
Do not create any new variables.

Do you understand what camel case is?

It is asking you to make sure that the declared variables and the assignments match, and are written in camel case

For example

var iamAVARiable;

IAMAVARiable = "Hi";

Doesn’t work because they are different variables. So you need to make sure that the variable is written in the same way in both places, using camel case

var iAmAVariable;

iAmAVariable = "Hi";

I figured it out after going over instructions again. Thanks

1 Like