Chapter 2Variables

Programming is basically the manipulation of data. In order to manipulate it, though, we first need to store it somewhere. In JavaScript, variables are the most basic form of data storage. Just like in algebra, variables are representatives of information we want to work with. Unlike algebra, though, there’s no restriction to only using letters. We can use whole words to more accurately describe what we’re dealing with, such as name, tax, length, or width. We can also use multiple words combined together, like firstName, taskList, or timeToLive. Notice that the first word in each multiword variable name is all lowercase, while the first letter of each subsequent word is capitalized. This is known as camel casing, and it is ...

Get Jump Start JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.