const users = [
{
index: 0,
isActive: false,
balance: 2397.64,
age: 39,
},
{
index: 1,
isActive: true,
balance: 2608.48,
age: 33,
},
{
index: 2,
isActive: true,
balance: 1699.99,
age: 25,
},
];
//4)Reduce
const totalBalance = users.reduce((acc, user) => {
console.log(acc, user);
}, 0); |