

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Why is case sensitivity so much more important in JavaScript?
A script is in plain text and not just markup like HTML, which is case insensitive. In JavaScript, the while keyword, should be "while", not "While" or "WHILE". Case sensitivity is important since it is closely related to HTML, but some methods and events are mentioned differently.
Some tags and attributes in HTML have the same name as JavaScript objects and properties. In HTML, the attribute and tag names are case-insensitive. The close association of HTML and JavaScript can lead to confusion, so case sensitivity is more important in JavaScript. For example, HTML onclick event attribute is mentioned as onClick in HTML but should be onclick in JavaScript.
The following two words in JavaScript are completely different:
var demo; var DEMO;
The following are different object due to the case-sensitive features of JavaScript:
function Employee(id, name, subject){ this.id = id; this.name = name; } var employee = new Employee("ee1", “John”,”30”);
While working with JavaScript, do check for capitalization of variable, function and object name. This will prevent syntax and other errors.
- Related Questions & Answers
- Why is Rust Programming language loved so much?
- Why is that Air Conditioners consume so much electricity?
- Who is Kumar Vishwas? Why he is so much known as poet?
- Why there is so much fuss about MS Dhoni's retirement?
- Implement case sensitivity in MySQL SELECT statements
- Why is indentation important in Python?
- Who is more important, wife or mother?
- Change user settings for case sensitivity in SAP 6.0
- Why is water management important for us?
- Why is conservation of natural resources important?
- Which out of beauty and brain is more important?
- Why is the Indian monsoon so unpredictable?
- Creating an empty HybridDictionary with specified case sensitivity in C#
- What is Sensitivity Analysis?
- What is data mining and why is it important