I just found out, that I can not chain "less than" operators in JavaScript. I wonder if anyone know why?
Example:
console.log ("should be false but is", (0 < 3 < 2)) // true
I can't find any documentation that says that, this expression will short-circuit after the first comparison (0 < 3
). So why is the last comparison not made?
I have tested the expression in nodejs 16 (V8) and Firefox 111 (SpiderMonkey).