JavaScript: Reduce product #25
Ready — edit the code above and click Run.
console.log([...Array(8)].reduce((a,_,i)=>a*(i+1),1));
Try solving on your own first, then reveal the official answer.
Array methods are core to JS interviews.