Is JavaScript case sensitive - JavaScript Tutorial

Is JavaScript case sensitive

BLUF: This tutorial on Is JavaScript case sensitive provides an in-depth look at JavaScript's core features. It includes practical examples and code snippets to help you master modern JS development.
Key Discovery: Is JavaScript case sensitive

Understanding Is JavaScript case sensitive is crucial for building dynamic, interactive web applications. Explore the examples below to see it in action.

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

Example

<!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

Input Required

This code uses input(). Please provide values below:

Logic Practice
Install Logic Practice
Add to home screen for a faster app-like experience