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 ...

Get Sams Teach Yourself JavaScript™ in 24 Hours, Fifth Edition now with O’Reilly online learning.

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