I'm trying to Sum Array amount of Laravel Relationship Using Vuejs using computed.
By the Way its Return NaN Result....
computed: {
subTotal() {
return this.items.reduce((total, item) => {
return total + parseFloat(item.deposits.amount);
}, 0);
}
},
Thanks.....

itemsvariable (which can't be seen in the image? It looks like what you really want is to loop thedeposits. Because from this code, you're trying to getitem.deposits.amount, butdepositsis an array..