 Open in App
Not now

# JavaScript Operators Complete Reference

• Last Updated : 06 Mar, 2023

Operators are used to performing specific mathematical and logical computations on operands. In other words, we can say that an operator operates the operands. In JavaScript, operators are used to comparing values, perform arithmetic operations, etc.

Example:  In this example, we will use an operator to perform an operation.

## Javascript

 `var` `a = 17;``var` `b = ``"GeeksforGeeks"``;``var` `c = ``""``;``var` `d = ``null``;`` ` `console.log(``"Type of a = "` `+ (``typeof` `a));``console.log(``"Type of b = "` `+ (``typeof` `b));``console.log(``"Type of c = "` `+ (``typeof` `c));``console.log(``"Type of d = "` `+ (``typeof` `d));``console.log(``"Type of e = "` `+ (``typeof` `e));`

Output: As you can see, we have used the typeof operator to check the variable type.

```Type of a = number
Type of b = string
Type of c = string
Type of d = object
Type of e = undefined```

The Complete List of JavaScript Operators is listed below:

JavaScript Arithmetic Operators: These are the operators that work on numerical values and then return a number. These are basically used to perform mathematical operations.

JavaScript Comparison Operators: These are the operators that are used to perform equality or difference comparisons between the values. It checks whether an element is greater, smaller equal, or unequal to the other element.

JavaScript Logical Operators: These are the operators which allow us to compare variables or values. The logical operator is mostly used to make decisions based on conditions specified for the statements. It can also be used to manipulate a boolean or set termination conditions for loops.

JavaScript Bitwise Operators: These operators convert the number to a 32-bit binary number and perform the bitwise operation. The number is converted back to the 64-bit number after the result.

JavaScript Assignment Operators: These operators assign the value of the right-hand operand to its left-hand operand. That is if a = b assigns the value of b to a.

Few Important JavaScript Operators: