Chapter 2. Variables: storing data in your program

This chapter covers

  • Storing and using information with variables
  • Declaring variables
  • Assigning values to variables
  • Displaying variable values on the console

Get Programming with JavaScript has been written as a gentle introduction to programming. This chapter, then, is a gentle introduction to a gentle introduction. As far as adventures go, you hardly leave the house. You can think of it as the packing stage for your journey, vitally important—you don’t want to get to the airport without your passport or to the Oscars without your selfie stick—but not the main event.

Almost without exception, programs store, manipulate, and display data. Whether you’re writing a system for blogging, ...

Get Get Programming with JavaScript now with O’Reilly online learning.

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