O'Reilly logo

JavaScript Step by Step by Steve Suehring

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Working with variables and data types

After completing this chapter, you will be able to

  • Understand the primitive data types used in JavaScript.

  • Use functions associated with the data types.

  • Create variables.

  • Define objects and arrays.

  • Understand the scope of variables.

  • Debug JavaScript using Firebug.

Data types in JavaScript

The data types of a language describe the basic elements that can be used within that language. You’re probably already familiar with data types, such as strings or integers, from other languages. Depending on who you ask, JavaScript defines anywhere from three to six data types. (The answer depends largely on the definition of a data type.) You work with all these data types regularly, some more than others.

The six data ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required