Given this code:
[1, 2].sort(a => a == 1 ? 1 : 0)
If I run it in Chromium (v75) I get [1, 2]
. However, if I run the same code in Firefox (Nightly) I get [2, 1]
.
Similar differences exist between Node v10 ([2, 1]
) and v12 ([1, 2]
).
Why is this?