let arrNum = [10, 20, 30, 40, 50, 60]; let reducedArr = arrNum.reduce(function (f , s) { // (f) for the first element (s) for the seconde element ; return f *= s; }); console.log("reduced Array" , reducedArr);
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