JavaScript comparison operators

Posted by Editorial Staff | Updated on

JavaScript Comparison Operators: In this example, we have shared JavaScript comparison operators with example. Comparison operators Returns true if the operands are equal. Returns true if the operands are not equal. Returns true if the operands are equal and of the same type.

JavaScript Comparison Operators

OperatorSignDescription
Equal==If both operands are equal, returns true.
Identical equal===If both operands are equal and/or same data type, returns true.
Not equal!=If both operands are not equal, returns true.
Identical not equal!==If both operands are not equal and/or same data type, returns true.
Greater than>If left operand larger than right operand, return true.
Less then<If left operand smaller than right operand, return true.
Greater than, equal>=If left operand larger or equal than right operand, return true.
Less than, equal<=If left operand smaller or equal than right operand, return true.

Example: JavaScript Comparison Operators


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers