> or designed languages on which trillions of dollars of commerce depend
Brendan Eich probably scores even higher on that scale.
Brendan Eich probably scores even higher on that scale.
What's ambiguous about that? :-P
typeof(true) is of type 'Boolean' and typeof(1) is of type 'number'.
Do they compare to the same type? Nope, therefore is false in both cases.
Try the following:
let foo = true;
true === foo === true; // returns true.You might mean it shouldn't work? but alas it does (because of 'lopsided equality tables'). Try the following: open the console of your browser, type the following:
true == 1 === true
and press enter - tada! You can also check out this SO answer if you are sufficiently flabbergasted: https://stackoverflow.com/a/12236341