what is <> operator in javascript

  • A+
Category:Languages

I just run into js code which look like this

    let b = 0;     let d = 1 <b> 2;     console.log(d)

so what <b> mean ?


There is no <> operator in JavaScript. let d = 1 <b> 2; is the same as:

let d = (1 < b) > 2; 

Which is always false, because 1 < b is either true or false and true > 2 and false > 2 are both false.

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: