Javascript Operators – Example Logical and Comparison Operators

In JavaScript two types of Operators are used to perform specific task.

Arithmetic and Assignment operator.

Arithmetic Operators:

The Arithmetic operators are (+ , – , * , / ) to compute or manipulate values.


<!DOCTYPE html>
<h2>Arithmetic and Assignment Opertor Example</h2>
<p>The = operator used to assign values and (+) Operator to add two Values</p>
<p id="darkweb"></p>
var x, y;
x = 4;
y = 8;
document.getElementById("darkweb").innerHTML = x + y;

JavaScript Operators

In JavaScript there are two types of operators  i.e. Arithmetic operators & Assignment Operators.

Arithmetic Operators:

There are some Arithmetic operators in below table:


Assignment Operator in JavaScript:

These are the following Assignment Operators in JS.


JavaScript Comparison Operators:

These are the following comparison operators in JS:

==Equal to
===Equal value & Equal Type
!=Not equal
!==Not equal value or not equal  type
Greater than
Less than
>=Greater than equal to
<=Less than equal to
?Ternary operator

Stay in touch. Ask Questions.
Lean on us for help, strategies and expertise.

Leave a Reply

Your email address will not be published. Required fields are marked *