A blurred photograph of train rails in a tunnel

One of the common frustrations in looping through iterable elements in JavaScript is that they typically take a not-insignificant amount of time to setup: a classical for loop takes a variable, an iterator and a condition just to get started.

JavaScript’s new for…of loop has a native understanding of iterable structures, removing the need for much of that preparation and allowing you to get right to manipulating data.