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 2. Foundation JavaScript > Variables and data types

2.5. Variables and data types

At the most fundamental level we have variables and data types. They are the building blocks of JavaScript that allow us to do some pretty cool stuff.

2.5.1. Variables

If you ever want to remember something when programming, you'll probably use a variable. The sole purpose of a variable is to hold a value (a piece of data) for retrieval at a later date. In this way they are very much like what you may have encountered while learning algebra at school. Remember those crazy formulas you had to work out that had numbers assigned to letters (e.g., x=3)? Those letters are variables, they store a value.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

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

  

Start a Free Trial


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