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 6. Scripts That Do More

What You’ll Learn in This Hour

• Using conditional statements

• Comparing values with comparison operators

• Applying logical operators

• Writing loops and control structures

• Debugging your scripts

In the last hour of Part I you took a quick trip through the data types that JavaScript variables can contain. To create anything but the simplest scripts, though, you’re going to need your code to make decisions based on those values. In this hour we examine ways to recognize particular conditions and have our program act in a prescribed way as a result.

You also learn how to use browser-based tools to help debug these more complex JavaScript programs.

Conditional Statements

Conditional statements, as the name implies, ...

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