Javascript Operators

Javascript Operators

JavaScript operators are used to assign values, compare values, perform arithmetic operations, and more. There are different types of operators for different uses. Here’s a list of JavaScript operators and a brief description of them.

Arithmetic Operators

Arithmetic operators are used to do math operations / calculations on numbers

Operator Description
+
Addition
Subtraction
* Multiplication
/ Division
%Remainder of a division (10 % 3 = 1)
10 can be devided by three, three times and 1 is what is left or the remainder


Increment and Decrement Operators

OperatorDescription
++Increment
Decrement

Assignment Operators

Operator Description
= Assignment
+=
Add and assign. For example, a += b is the same as a = a + b
-= Subtract and assign. For example, a -= b is the same as a -= a – b
*=
Multiply and assign. For example, a *= b is the same as a = a * b.
/= Divide and assign. For example, a /= b is the same as a = a / b.
&= Modulus and assign. For example, a %= b is the same as a = a % b.

Comparison Operators

Operator Description
== Is equal to
=== s identical (is equal to and is of the same type)
!=not equal
!==
Is not identical
>
Greater than
>=
Greater than or equal to
< Less than
<= Less than or equal to

Logical or boolean Operators

Operator Description
&& and
|| or
!not

String Operators

OperatorDescription
= Assignment
+ Concatenate ( join / add two strings together )
+= Concatenate and assign
Comments are closed.
error

Let's make it official :) Subscribe to my Youtube Channel.