News for hackers. Stuff that matters.
Re:One page: Javascript in 10 minutes by chrisbroadfoot on Wednesday January 26, 2011 @03:52AM (#2142648)

  Property Maps

  var emptyMap = {};

In JavaScript, these are called Objects. I don't think it's right for them to be called "property maps" in a tutorial like this.

The heading called "Objects" should be renamed something like "Constructors" too.

Also, using

  for (var i in array)
is not the preferred way of iterating over an array (the for construct does not guarantee ordering).
Re:One page: Javascript in 10 minutes by user24 on Wednesday January 26, 2011 @04:05AM (#2142679)
for...in loops also have the drawback of iterating over inherited properties. eg if I extended the prototype of Array with some method, then for...in would iterate over that method too.

traditional for loops incrementing until length is reached are preferable for arrays (personal style: for(var i=0,l=array.length ; i<l ; i++))

For objects, for...in with a hasOwnProperty check is preferred, I think (if you're going to be iterating over objects that is, which usually means you're using an object as a textually-indexed array, which isn't that great).

Over all a nice introduction though.

Re:One page: Javascript in 10 minutes by cema on Wednesday January 26, 2011 @08:02AM (#2143124)

  using an object as a textually-indexed array,
  which isn't that great
Using it as a hash table is just fine.
Re:One page: Javascript in 10 minutes by user24 on Wednesday January 26, 2011 @08:19AM (#2143159)
Yes, my problem was with people then wanting to iterate over said hashmap, not with using it as a hashmap in the first place. I could have worded that better, thanks.

I mean if you're going to want to iterate over it, you should probably be using an array instead.

Re:One page: Javascript in 10 minutes by BonsaiDen on Wednesday January 26, 2011 @04:57PM (#2145364)
The whole page disqualified itself instantly, not a single note about `hasOwnProperty` on the whole page :(