console.log(1 < 4 < 3); it will return true instead of false because the javascript sees it as:
console.log(true < 3);
“true” would be coerced to 1 and when compared will be 1 < 3 which will be true.
I never knew that. I had always thought it was just a quirk of JavaScript. Thanks for clearing things up!
I never knew that. I had always thought it was just a quirk of JavaScript. Thanks for clearing things up!
Yes, it is because of coercion.
Thanks for reading the post.