Is JavaScript a case sensitive language?

JavaScript is a case-sensitive language. This means that the language keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters.

So the identifiers Time and TIME will convey different meanings in JavaScript.

NOTE − Care should be taken while writing variable and function names in JavaScript.


The following example shows JavaScript is a case-sensitive language:

<!DOCTYPE html>
      <h3>My favorite subject</h3>
      <p id="demo"></p>
          var subject, Subject;
          subject = "Java";
          Subject = "Maths";
          document.getElementById("demo").innerHTML = subject;

Updated on: 02-Jan-2020

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started