JavaScript Operators
This are some of the most commonly used JavaScript operators:
You can conduct a number of operations on various kinds of data using JavaScript's extensive set of operators. The most popular JavaScript functions are listed below:
Arithmetic Operators:
These operators are used to perform mathematical operations like addition, subtraction, multiplication, and division. They include + (addition), - (subtraction), * (multiplication), / (division), % (modulus), ++ (increment), and -- (decrement).
Example:
Assignment Operators:
These operators are used to assign values to variables. They include = (assignment), += (addition assignment), -= (subtraction assignment), *= (multiplication assignment), /= (division assignment), %= (modulus assignment).
Example:
Comparison Operators:
These operators are used to compare two values and return a Boolean value (true or false). They include == (equality), === (strict equality), != (inequality), !== (strict inequality), > (greater than), < (less than), >= (greater than or equal to), and <= (less than or equal to).
Example:
Logical Operators:
These operators are used to perform logical operations on Boolean values. They include && (logical AND), || (logical OR), and ! (logical NOT).
Example:
Bitwise Operators:
These operators are used to perform bitwise operations on integer values. They include & (bitwise AND), | (bitwise OR), ^ (bitwise XOR), ~ (bitwise NOT), << (left shift), and >> (right shift).
Example:
Last updated