by jhaglund · 13y ago · 0 comments
> a = []
> a[a[typeof a]='huh', void a] = 'puh'
> console.log(a)
[object: "huh", undefined: "puh"]
huh... you can do this too > a = []
> a[a[a[typeof a]='huh'] = 'puh'] = 'woh'
> console.log(a)
[object: "huh", huh: "puh", puh: "woh"]The only thing to really look bad is chrome, which is surprisingly easy to kill.
> a.length
0
Same as the article, you are adding properties to a. A is an array, not an hashmap. Any index that is not a number will create a property, not a new index.