bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/JavaScript/Debugging, Projects, and Reference
JavaScript•Debugging, Projects, and Reference

JavaScript Operators Reference

Concept visual

JavaScript Operators Reference

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Complete Operators Reference

Revised July 2025

Type

Common Use

Example

Assignment

Formula

Assigns values to variables x = 5

Arithmetic

Formula

Performs arithmetic between variables x = y + 2

Comparison

Formula

Compares variables x > 8

Logical

Defines the logic between variables

Formula

(x > 0 || x > 0)

Bitwise

Formula

Performs bitwise operatins on 32 bits numbers x = 5 & 1

Misc

Miscellaneous operators void(0)

JavaScript Assignment Operators

Assignment operators assign values to JavaScript variables.

Formula

Given that x = 10 and y = 5, the table below explains the assignment operators:

Oper

Formula

Name / Link

Example

Same As

Result

=

Formula

Simple x = y x = y x = 5

+=

Formula

Add x += y x = x + y x = 15

-=

Formula

Subtract x -= y x = x - y x = 5

*=

Formula

Multiply x *= y x = x * y x = 50

/=

Formula

Divide x /= y x = x / y x = 2

%=

Formula

Remainder x %= y x = x % y x = 0

Formula

Colon x: 45 x = 45 x = 45

Logical Assignment Operators

Oper

Formula

Name / Link

Example

Result

&&=

And

Formula

true &&= 10 x = 10

||= OR

Formula

false ||= 10 x = 10

??=

Formula

Nullish null ??= 10 x = 10

Learn More:

Previous

JavaScript Debugging Breakpoints

Next

Project - To-Do List