paint-brush
The Recommended Way to Iterate Over Arrays in JavaScriptby@bafiam
6,047 reads
6,047 reads

The Recommended Way to Iterate Over Arrays in JavaScript

by Stephen Gumba2mMay 19th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

When dealing with an array, there is a number of ways one can iterate through the elements starting from the first at index 0 all the way to the last element in the array. In my learning process I have come across 6 looping methods namely for (let i = 0; i < arr.length; ++i) which allow loop break and continue to skip a current iteration. The forEach is a more functional and declarative syntax compared to the rest of the methods. This allows us to execute through the entire arrays without skipping or breaking.
featured image - The Recommended Way to Iterate Over Arrays in JavaScript
Stephen Gumba HackerNoon profile picture
Stephen Gumba

Stephen Gumba

@bafiam

L O A D I N G
. . . comments & more!

About Author

Stephen Gumba HackerNoon profile picture
Stephen Gumba@bafiam

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite