Replace your loops by Array methods - map()
In the last article, I wrote about forEach() method. In these, I will show you the map() method :)
One thing I had not shown, is about second argument of the forEach(). You can pass an object - in this case, an array -, that…