Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
We’ve seen how you can make decisions in code using the if statement and execute other code to match the results of those decisions.
You can also use the conditional operator to make decisions. This operator lets you evaluate an expression and execute code depending on the result. The conditional operator has this format: