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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.