A great speech from Nicholas C. Zakas points out that the following pattern for JavaScript loops (19:55) uses simpler syntax and performs better:
var i = values.length; while (i--){ process(values[i]); } |
Nick’s slide at 22:25 sums it up, “Work Avoidance.”
