Multiplied arrays in array in javascript [closed]

How can i multiple content in all arrays in array?

[[3, 2], [1, 2, 1], [7, 8]] //=>

[6, 2, 56]

I don’t understand how i need to use “for…of”.

Answer

It can be done with the following one-liner:

const arr= [[3, 2], [1, 2, 1], [7, 8]];
console.log(arr.map(ar=>ar.reduce((a,c)=>a*c)))