const array = [1,2,3,4] const newArray = array.map(a => a * 2) console.log(newArray) // [2,4,6,8]
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter