A for (init; check; update) { ... } B init; while(check) { ... update; } A and B are the same. If thing is an Array A for (var i in thing) B for (var i = 0; i < thing.length; i++) A and B are the same. Normal for-loop usage for (var i = start; i <= end; i++)