O'Reilly logo

Sams Teach Yourself JavaScript™ in 24 Hours, Fifth Edition by Phil Ballard, Michael Moncur

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

Hour 5. Different Types of Data

What You’ll Learn in This Hour

• About the various data types supported by JavaScript

• Conversion between data types

• How to manipulate strings

• How to declare and populate arrays

• Managing array contents

We use the term data type to talk about the nature of the data that a variable contains. A string variable contains a string, a number variable a numerical value, and so forth. However, the JavaScript language is what’s called a loosely typed language, meaning that JavaScript variables can be interpreted as different data types in differing circumstances.

In JavaScript, you don’t have to declare the data type of a variable before using it, as the JavaScript interpreter will make its best guess. If you put ...

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