O'Reilly logo

HTML5 Programming with JavaScript For Dummies by John Paul Mueller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4

Embracing JavaScript Variables

In This Chapter

arrow Creating and using variables

arrow Using Boolean values

arrow Using numeric values

arrow Using strings

arrow Defining data collections with arrays

The purpose of most applications is to work with data in some way. Data are defined as any kind of information you want to interact with in some fashion — anything from simply displaying it to creating new information or manipulating existing information to see it in new ways. Variables provide storage containers for data. You store the data until you need to use it in the application, take the data out, do something with it, and then put it back into the variable when you’re done. The term variable is appropriate because you can store different data items in a variable — the content is, well, variable. The variable content changes to meet application needs. This chapter helps you understand how variables work in JavaScript and how you can use them to perform tasks within your application.

The chapter divides ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required