Is Javascript case sensitive?

I wrote Console.log(24);
got error then wrote console.log(24); then got output .
means javascript is case sensitive.

3 Likes

yes you’re right JS is case sensitive which means TIME and Time are two different things for JS to handle

63 Likes

JS is case sensitive in all and any cases. let myAge, let myage and let MYAGE are all different variables and the function you are trying to call is console.log() and not Console.log, which will cause an error.

42 Likes

Why can’t we put letters inside the ()? When I put ā€˜console.log(hi);’, it gave me an error.

5 Likes

because hi is now an undefined variable, so either: defined the variable or make hi a string.

14 Likes

Programming is about problem solving, in on purpose left out the bit how to make it a string.

6 Likes

Don’t worry. stetim94 is correct; it is an undefined variable. Although, that doesn’t exactly help what you are trying to achieve.

To print letters, you have to add a quotation of your choice. Here is a simple example.

console.log(ā€˜hi’)
console.log(ā€œhiā€)

You can also have numbers within the quotations as well. I did just realize that you posted that question on January 4th, but I still hope that you’re coding! Keep up the great work!

33 Likes

Provided example helps me understand that Javascript is case sensitive.

3 Likes

simple enough? Create a variable and give it any value. Then try to log the variable but changes one of the letters of the variable to uppercase (or lowercase)

you will see that variable names are case sensitive.

3 Likes

When you write console.log(hi); you are trying to log the keyword hi. However, as hi is neither an inbuilt JavaScript keyword nor a keyword that you created (such as a variable, a function, an object, etc.) you will get an error saying that hi is undefined. What you are trying to do is to log the text (or string) ā€œhiā€, not the keyword. To accomplish this, you must wrap hi in quotation marks - either double or single quotes, like the following: console.log("hi");

20 Likes

I did the same thing. It tells you to get into the habit of putting the ; at the end. It didn’t help that I put a capital C not a loser case c. So yes it is case sensitive

I’m going to be blunt here, I have never heard of a programming language that is taken seriously and yet is not case-sensitive.

JavaScript is no exception to this. It is case-sensitive, along with a lot of other programming languages.

Yes Javascript is case sensitive. If you do for example:.

var javaScript = createFont(ā€œMonospaceā€);
textFont = (javaScript);

It would work, but let’s say you did this:.

var javaScript = createFont(ā€œMonospaceā€);
textFont = (JavaScript);

It would not work, because of the capital ā€œJā€ in JavaScript on the second example.

3 Likes

its annoying that its case sensitive

2 Likes

Yes, but it looks more organized. :wink:

3 Likes

BTW, welcome to the Codecademy community. :smiley:

2 Likes

I love it’s case sentisive!! :heart_eyes:

2 Likes

JavaScript is Case Sensitive means

All JavaScript identifiers are case sensitive .

But let myName; is not same as let Myname; or let MyName; so Console.log and console.log are not same so it will cause an error

2 Likes

The term, case sensitive is not really accurate, though we may contrive it to equate to the real case, which is, JS is character sensitive. It searches in the current namespace and on up the scope chain for the variable or function name it is given. If a complete character match is not found, then it throws an error.

12 Likes

I learned very early on that it is indeed case sensitive. I did remember that simple variations simply don’t work or are very different things to the system.

1 Like