web analytics

Javascript Is Case Sensitive


codeling 1573 - 6555
@2019-11-27 11:49:13

JavaScript is a case-sensitive language. This means that language keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters. The while keyword, for example, must be typed “while”, not “While” or “WHILE”.

@2019-11-27 11:54:08

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 or onclick in HTML but should be onclick in JavaScript.

@2019-12-21 19:07:18

Another exmaple is that the following two function calls are different:


Some time this kind of name/id difference is very hard to notice in the Javascript code.


You must Sign In to comment on this topic.

© 2022 Digcode.com