Tue Dec 24 2024 22:08:11 GMT+0000 (Coordinated Universal Time)
Saved by @davidmchale
const bankdeposits = accounts .flatMap(item => item.movements) // combines all arrays into one .filter(item => item > 0) .reduce((total, item) => (total += item), 0); console.log(bankdeposits); // 25180
Copy this HTML code:
Preview:
open_in_newInstructions on embedding in Medium
Comments