WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

JavaScript comparisons



Comparison Operators

Comparison operators are used in logical statements to determine equality or difference between variables or values.

  • TRUE / FALSE

Operator Description Comparing Returns Try it == equal to x == 8 false x == 5 true x == "5" true === equal value and equal type x === 5 true x === "5" false != not equal x != 8 true !== not equal value or not equal type x !== 5 false x !== "5" true x !== 8 true > greater than x > 8 false < less than x < 8 true >= greater than or equal to x >= 8 false <= less than or equal to x <= 8 true