Hacker News new | past | comments | ask | show | jobs | submit login

I would just say that there are big differences between a JS `for` loop (`for in` in CS) and an ES5 `forEach`. The fact that you are creating a new function scope and are not returning all elements as you might expect:

  arr = new Array 3
  arr.push 4

  ( alert el for el in arr )

  arr.forEach alert



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: