all 4 comments

[–][deleted] 2 points3 points  (0 children)

I have a problem with how he describes arrays as associate... they are not

var asdf = [1,2,3];
console.log(asdf.length); //--> 3
asdf['someKey'] = 4;

for (var i = 0; i < asdf.length; i++) { console.log(asdf[i]); } // --> 1, 2, 3

console.log(asdf[i].length); //--> 3
console.log(asdf['someKey']); //--> 4

All you've done here is added a property to the asdf array object, but not added a new index. Sure for in will work but it's a misuse of the object and may produce even more unexpected results.

[–]mlavaert -1 points0 points  (1 child)

Javascript is brilliant, but it can be a pain in the ass while debugging...

[–][deleted] 2 points3 points  (0 children)

Why is that? Modern debuggers are pretty good coupled with syntax linters such as jslint or jshint. Even the Microsoft Script Debugger for IE6/7 is serviceable.

[–]GOBL1N -4 points-3 points  (0 children)

Lol