# ES6 | Operators

• Last Updated : 07 Mar, 2022

An expression is a special kind of statement that evaluates to a value. Every expression consists of

• Operands: Represents the data.
• Operator: which performs certain operations on operands.

Consider the following expression – 2 / 3, in the expression, 2 and 3 are operands and the symbol /is the operator.
JavaScript supports the following types of operators:

• Arithmetic Operators
• Relational Operators
• Logical Operators
• Bitwise Operators
• Assignment Operators
• Type Operators
• Miscellaneous Operators

Arithmetic Operators: As we know these are the basic mathematical operators available in JavaScript ES6.

Example:

## javascript

 ``

Output:

```Sum : 13
Difference : 8
Product : 26.25
Quotient : 4.2
Remainder : 0.5
Value of num1 after pre-increment : 11.5
Value of num1 after post-increment : 11.5
Value of num2 after pre-decrement : 1.5
Value of num2 after post-decrement : 1.5```

Relational Operators: An operator that compares two values. Relational operators are sometimes called comparison operators.

Example:

## javascript

 ``

Output:

```11>12 : false
11=11 : true
12<=12 : true
11==11 : true
11!=11 : false```

Logical Operators: Logical operators are used to combine two or more relational statements.

Example:

## javascript

 `            `

Output:

```13>12 && 12>11 && 9==9 : true
11>12 && 12>11 && 9==9 : false
11>12 || 12>11 || 9==9 : true
11>12 && (12>11 || 9==9) : false```

Bitwise Operators: A bitwise operator is an operator used to perform bitwise operations on bit patterns or binary numerals that involve the manipulation of individual bits.

Example:

## javascript

 ``

Output:

```2&3 : 2
2|3 : 3
2^3 : 1
~4 : -5
2<>3 : 0```

Assignment Operators: An assignment operator is the operator used to assign a new value to the variable, property, event or indexer element.

Example:

## javascript

 ``

Output:

```a = b : 10
a += b : 20
a -= b : 10
a *= b : 100
a /= b : 10```

Type Operators: It is a unary operator. This operator returns the data type of the operand.
Syntax:

`typeof(operand)`

Example:

## javascript

 ``

Output:

```a is number
b is string
c is : boolean
d is : function```

Miscellaneous Operators:These are the operators that, does different operators when used at different types of occasions.

Example:

## javascript

 ``

Output:

```a+b : GeeksforGeeks=>A Computer science portal.
2>3 :No, It is not.
d = -d : -9```

My Personal Notes arrow_drop_up