Indeed, it is a language that is sensitive to case, indicating that identifiers, keywords, variables, and function names need to be consistently capitalized.
Similar to various other programming languages, JavaScript is governed by a specific set of guidelines for crafting JavaScript programs or scripts. One of the essential rules that must be adhered to is the proper capitalization when naming keywords, identifiers, functions, and variables.
What does it really mean?
This indicates that if you have defined a variable called "temp" and attempt to display its value by using "Temp" instead of "temp", the operation will fail and likely result in an error.
To gain a clearer understanding, let us consider the following example:
Program
<!DOCTYPE html>
<html>
<body>
<h3>JavaScript is case Sensitive language</h3>
<p id="demo"></p>
<script>
var marks,Marks;
marks=0; //variable 1
Marks=100; // variable 2
document.write(Marks);
</script>
</body>
</html>
Explanation of program
In the preceding code, we established two distinct variables: Marks and marks, assigning them the values of 0 and 100, respectively. When we output the value of the variable "marks," it will display 100 rather than 0. This behavior occurs because, in JavaScript, the identifiers marks and Marks are considered different, despite their similar spellings.
Output