DEV Community

Discussion on: Useful JS functions you aren't using: Array.map

Collapse
 
revent profile image
Roberts Guļāns

one could even change this:
arr2 = arr1.map(function(a){return a.replace(/a/gi,"b")});
to ES6 syntax:
arr2 = arr1.map(a => a.replace(/a/gi,"b"))