Skip to content

Comment on Intro to CoffeeScript

Comments

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
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.