Hacker News new | ask | show | jobs
by nine_k 4501 days ago
`for (var i=0; i<l.length; i++)` is so 1970. In Javascript, you have array.map and $.each, and can define functions in-place.

Same applies to Python, BTW; get used to list comprehensions and generators and you cannot look back.

1 comments

These aren't supported everywhere in javascript.
jQuery or underscore provide them on every sane JS platform. These are not hard to write by hand, too.