Chapter 3

Using Variables

Key Skills & Concepts

   Understanding Variables

   Why Variables Are Useful

   Defining Variables for Your Scripts

   Understanding Variable Types

   Using Variables in Scripts

Now that you have learned the basics of adding JavaScript to a Web page, it is time to get into the inner workings of the language. Since variables are an important part of JavaScript coding, you will need to know as much as possible about what they are and why they are useful in your scripts. Once you have an understanding of how variables work and what they can do, you will be able to move on to other topics that build on the use of the various types of variables.

In this chapter, you will begin by learning what variables are and why ...

Get JavaScript: A Beginner's Guide, Fifth Edition, 5th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.