Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the <> operator in JavaScript?

Tags:

javascript

I just ran into JavaScript code which looks like this:

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

So what does <b> mean?

like image 581
Ali Faris Avatar asked May 01 '18 19:05

Ali Faris


Video Answer


1 Answers

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.

like image 186
Paul Avatar answered Sep 21 '22 13:09

Paul