Benchmarking Array Traversal in Javascript – Going Backwards is Fastest

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. Keep in mind that these benchmarks were run in a Chrome browser on Codepen. Results will vary by browser/interpreter. For a working example of these benchmarks, take a look at this codepen: https://codepen.io/lane-c-wagner/pen/GRRGryr. …