This page looks best with JavaScript enabled

All JavaScript Comparison Operators

 ·  β˜• 1 min read  ·  πŸ‘½ john hashim

Javascript as a Programming language it has its uniques comparison Operators that can be used to compare Number or strings
Remember the Operation always returns a boolean.

  • < less than
  • <= less than or equal to
  • > greater than
  • >= greater than or equal to
  • === identity to
  • == equal to
  • != not equal to
  • !== not identical to

When comparing strings, those operators check for the letter ordering, encoded in Unicode. The bigger the letter value, the bigger the letter is to the operator when comparing.

1
2
3
4
5
6
7
8
const b = 2
b >= 1 //true

const b = 4
b === 4 //true

const b = 6
b < 2 //false
Share on

john hashim
WRITTEN BY
john hashim
Web Developer