function forEach for loop

[For loops are faster than while](http://jsperf.com/fastest-while-loops/4) loops it seems