Case sensitivity in JavaScript

JavaScript is a case-sensitive scripting language. What that means is that the language considers capital letters as different from their lowercase counterparts. For example, if you declare a variable called totalCost in JavaScript, you have to use totalCost to refer to that variable not TotalCost, TOTALCOST, or some other combination.

In JavaScript the case sensitivity does not just apply to variable names but also to JavaScript keywords, event handlers, and object properties or methods. Keywords in JavaScript are all lowercase, for example, while, for, if, else, and so on. On the other hand, methods (properties) use "camel-back" naming convention (first word is in lowercase and each successive first letter of each word is capitalized), for example, toArray(), lastModified(), and so on.