Operators

Operators can be placed into three categories—binary, unary, and ternary. Binary operators, most commonly associated with the concept of operator, take two (binary) expressions and combine them into a third complex or compound expression. However, a single expression can have several binary operators. For example, the following variable declaration uses multiple binary operators to define the variable:

						var calcAdd = (total / n ) + 73 

The divide (/) operator and the plus (+) operator are binary operators. The first combination occurs when the variable total is divided by the variable n. The two variables become a single value. That single value resulting from total divided by n is then added to the literal numeric value of 73, creating ...

Get JavaScript Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.