Learn Vue JS course Learn Javascript and Vue JS Learn VueJS course Learn VueJS Tutorial

Modern JavaScript: ES6 and beyond!

Learn Array.forEach and Array.map in JavaScript thumbnail image

Get access to the most comprehensive Vue.js video library in the world. Over 300 video lessons including the newest Vue 3 features.

Learn Array.forEach and Array.map in JavaScript

In this lesson, we'll learn how to use two new array helper methods that was introduced to JavaScript in ES6, namely the Array.forEach and Array.map functions.

The forEach method lets us execute a callback function on each array element.

The map method lets us create a new array with the results of calling a callback on every element in the array.