JavaScript Operator Precedence

Operator precedence describes the order in which operations are performed in an arithmetic expression.

Multiplication (*) and division (/) have higher precedence than addition (+) and subtraction (-).

As in traditional mathematics, multiplication is done first:

let x = 100 + 50 * 3;

When using parentheses, operations inside the parentheses are computed first :

let x = (100 + 50) * 3;

Operations with the same precedence (like * and /) are computed from left to right : Continue reading JavaScript Operator Precedence

JavaScript Operators

Javascript operators are used to perform different types of mathematical and logical computations.

Examples:

The Assignment Operator = assigns values

The Addition Operator + adds values

The Multiplication Operator * multiplies values

The Comparison Operator > compares values

JavaScript Assignment

The Assignment Operator (=) assigns a value to a variable:

Assignment Examples

let x = 10;

Continue reading JavaScript Operators