I am new to Javascript and I noticed when a variable is undefined
, comparing a number returns false
as below. Why does comparing undefined
with numbers return false
?
var a = undefined;
console.log(a < 10);
console.log(10 < a);
console.log(a == 10);