J

JavaScript Handbook

Clean • Professional

JavaScript Operators Overview

2 minute

JavaScript Operators Overview

JavaScript Operators are symbols that perform operations on values and variables — like adding numbers, comparing values, or combining strings.

Types of JavaScript Operators

learn code with durgesh images

1. Arithmetic Operators

Used for basic mathematical calculations.

OperatorDescriptionExampleResult
+Addition5 + 27
-Subtraction5 - 23
*Multiplication5 * 210
/Division10 / 25
%Modulus (Remainder)10 % 31
**Exponentiation (Power)2 ** 38
++Incrementx++Adds 1
--Decrementx--Subtracts 1

2. Assignment Operators

Used to assign or update variable values.

OperatorExampleSame As
=x = 5Assigns 5 to x
+=x += 2x = x + 2
-=x -= 2x = x - 2
*=x *= 2x = x * 2
/=x /= 2x = x / 2
%=x %= 2x = x % 2

3. Comparison Operators

Used to compare two values — returns a Boolean (true or false).

OperatorDescriptionExampleResult
==Equal (loose)5 == "5"true
===Strict Equal (checks type too)5 === "5"false
!=Not Equal5 != 3true
!==Strict Not Equal5 !== "5"true
>Greater Than7 > 3true
<Less Than7 < 3false
>=Greater or Equal5 >= 5true
<=Less or Equal3 <= 5true

4. Logical Operators

Used to combine multiple conditions.

OperatorDescriptionExampleResult
&&ANDx > 5 && y < 10true if both true
` `OR
!NOT!(x > 5)Opposite of condition

5. Bitwise Operators

Operate on binary numbers.

OperatorDescriptionExample
&AND5 & 11
``OR
^XOR5 ^ 14
~NOT~5-6
<<Left shift5 << 110
>>Right shift5 >> 12
>>>Zero-fill right shift5 >>> 12

6. String Operators

Used to join (concatenate) strings.

let first = "Hello";
let last = "World";
console.log(first + " " + last); // Hello World

7. Ternary (Conditional) Operator

Shortcut for if...else statements.

let age = 18;
let result = (age >= 18) ? "Adult" : "Minor";
console.log(result); // Adult

8. Type Operators

Used to check or convert data types.

OperatorDescriptionExampleResult
typeofReturns variable typetypeof "Hello""string"
instanceofChecks object typearr instanceof Arraytrue


Article 0 of 0