JavaScript: map()

Dec 16, 2020ยท

1 min read

Map() is one of the very useful functions. It creates a new array. The function (which will be passing in the map function) is going to apply to every element in the original array.

const fruits = ['apple', 'banana', 'grape']; => {
    console.log(`${item} ๐Ÿ˜‹`);

'item' can be replaced with any words



Reference: MDN