August 1999
Intermediate to advanced
1488 pages
72h 53m
English
Loops and conditionals give programs the power to make decisions and perform tasks multiple times. JavaScript provides the standard conditionals and looping structures that are available in many computer languages. In fact, these structures were patterned after those found in C, C++, and Java, so if you have written code in any of these languages, you will find this section very straightforward.
Conditional statements enable programs to make decisions based on preset conditions that use the operators discussed earlier in the chapter.
The if statement is by far the most common conditional statement simply because it is simple and easy to use. The format of a simple if statement looks like the following: ...
Read now
Unlock full access