O'Reilly logo

Beginning JavaScript with DOM Scripting and Ajax, Second Edition by Christian Heilmann, Russ Ferguson

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 2

image

Data and Decisions

Data and decision making are fundamental to every intelligent program. We’ll begin this chapter by looking at how JavaScript understands, or represents, data. This is important because JavaScript works with a number of data types and manipulates data according to its data type. You can generate unexpected results by mismatching data of different types. We’ll look at some of the more common data type problems, and you’ll see how to convert one type of data to another.

We’ll also be working with conditional statements and loops: two of the most valuable tools for decision making. To make decisions in a computer language, ...

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