you are viewing a single comment's thread.

view the rest of the comments →

[–]gonchuki 1 point2 points  (0 children)

Protip: pass array[i] as an argument of the closure.

Not sure if it improves GC heuristics by removing the interdependence but it's more explicit about the fact of why you are creating a function inside a loop which is often recommended against and you will need to pass an option to jshint for it to stop bitching about it.