Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
For conditional logic statements (like if/else or do...while) to work properly, they have to be able to make the right decision based on what they are checking for. To do this, they use a series of comparison and logical operators to help them make the decision. In JavaScript, there are seven different comparison operators and three logical operators, as well as a shorthand operator for the if/else statement, called the ternary operator. We’ve seen some of these already, but here’s the full list.