Too Long; Didn't Read
There are many ways to traverse an array in JavaScript. In this benchmark, we will look at five different ways and the pros and cons of each. These benchmarks were run in a Chrome browser on Codepen. Results will vary by browser/interpreter. The first two times running this after a fresh browser load are quite slow, but then it gets blazingly fast. This is because at each iteration the loop checks against a constant 0 zero value instead of calling the array's.length property.