4 ms·
>JavaScript doesn't know the result of a function until it is executed, and obviously it has to call the function to return the variable type. > +alert(1)-- T
by thedufer 13y ago
>JavaScript doesn't know the result of a function until it is executed, and obviously it has to call the function to return the variable type.
> +alert(1)--
That's a particularly poor example. There's no reason to expect `alert` to run there (in current Chrome, it doesn't) - a function can't return an l-value, so you don't have to wait for the return value to determine that it'll be invalid.
Also, I'm not sure what the unary + is supposed to achieve - it has the same precedence as post-decrement, with right to left associativity, so knowing that the post-increment will fail shows us that the + will never run.
- saurik 13y agoThis doesn't work in Apple's JSC either.