|
In case anyone wonders about the `!+[1,]` bit: In modern browsers, `[1,]` is the same as `[1]`. If you coerce it to number, you get 1. (You get "1" if you toString it.) In IE8, `[1,]` is the same as creating an array with a length of 2 whose first slot contains 1 and whose second slot was left empty. It's kinda like `[1, undefined]`, but there is no "1" key. If you coerce it to number, you get NaN. (You get "1," if you toString it.) If you coerce 1 to boolean and negate it, you get false. If you coerce NaN to boolean and negate it, you get true. So, basically, it just checks if trailing commas in array literals are handled incorrectly. |
I think there is something weird about the parsing of the comma in "if" statement in old IE.