O'Reilly logo

Web Programming with HTML5, CSS, and JavaScript by Dean

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

9.19 Comparison Operators and Logical Operators

We’re not done with the improved Water Balloons web page. We still need to present its calculateWater function, which checks for valid input and calculates the number of gallons of water needed to fill up the balloons. But all that checking and calculating uses Java Script operators that haven’t been introduced, or they’ve been introduced but not described fully. So in this section, we’ll take a little side trip where you learn about those operators, and in the next section, we’ll use those operators in implementing the calculateWater function.

Comparison Operators

As you know, an if statement’s heading includes a condition with parentheses around the condition, like this:

if (condition) { ...

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