Looping over Arrays: for vs. for-in vs. .forEach() vs. for-of This blog post compares four ways of looping over Arrays: The for loop: for (let index=0; index < someArray.length; index++) { const elem = someArray[index]; // ··· } The for-in loop: for (const key in someArray) { console.log(key); } The Array method .forEach(): someArray.forEach((elem, index) => { console.log(elem, index); }); The for