Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 9. Client-Side Scripting > Storing and Retrieving Data

Storing and Retrieving Data

JavaScript allows you to store and retrieve individual pieces of data as well as collections of data. Individual pieces of data are managed using variables. Collections of data are managed using arrays. You will learn how to work with both variables and arrays in the sections that follow.

Defining JavaScript Variables

In order to use a variable in a JavaScript, it must be declared (or defined). You can declare a variable explicitly or implicitly. An explicitly declared variable is defined before it is referenced using the var keyword. The following example demonstrates how to explicitly declare a variable.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint