JavaScript operators are symbols that are used to perform operations on operands. For example:
var sum=10+20;
Here, + is the arithmetic operator and = is the assignment operator.
There are following types of operators in JavaScript.
Arithmetic Operators
Comparison Operators
Logical Operators
Assignment Operators
Conditional Operators
Arithmetic Operators
Arithmetic operators are used to perform mathematical operations between numeric operands.
Comparison Operators
JavaScript language includes operators that compare two operands and return Boolean value true or false.
Logical Operators
Logical operators are used to combine two or more conditions. JavaScript includes following logical operators.
Assignment Operators
JavaScript includes assignment operators to assign values to variables with less key strokes.
Ternary Operator
JavaScript includes special operator called ternary operator :? that assigns a value to a variable based on some condition. This is like short form of if-else condition.
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
JavaScript operators are symbols that are used to perform operations on operands. For example:
var sum=10+20;
Here, + is the arithmetic operator and = is the assignment operator.
There are following types of operators in JavaScript.
Arithmetic Operators
Arithmetic operators are used to perform mathematical operations between numeric operands.
Comparison Operators
JavaScript language includes operators that compare two operands and return Boolean value true or false.
Logical Operators
Logical operators are used to combine two or more conditions. JavaScript includes following logical operators.
Assignment Operators
JavaScript includes assignment operators to assign values to variables with less key strokes.
Ternary Operator
JavaScript includes special operator called ternary operator :? that assigns a value to a variable based on some condition. This is like short form of if-else condition.