|
|
|
|
|
by locci
5473 days ago
|
|
Because [] is not syntactic sugar for new Array.
The code the article wrote about doesn't work in any implementation that I know of.
I think the ESv3 spec wasn't very clear:
"Create a new array as if by the expression new Array()."
But the implementations (always?) did the right thing, and the ESv5 spec is more clear:
it adds "where Array is the standard built-in constructor with that name." |
|
It obviously worked this way at some point (http://news.ycombinator.com/item?id=2668888), so I'm guessing the older IEs, at least, still have this flaw.