>var a = [1]; var b = [1]; console.log((b[0] % (a.push(1) / (a[0] ^ b.length))));
=0
It can be simplified to:
>1 % (1 / 0)
=0
or
>1%Infinity
=0
Expected behavior
I would expect it to return 1 (from 1 % Infinity). Running the test case on other JavaScript engines (Node, Hermes, and QuickJS), I get the expected 1.
https://github.com/espruino/Espruino/commit/ff487e008472deff8113a32ebd3217dbd606405c
Test case The original test case I ran:
It can be simplified to:
or
Expected behavior I would expect it to return 1 (from 1 % Infinity). Running the test case on other JavaScript engines (Node, Hermes, and QuickJS), I get the expected 1.