showing results for - "get the sum of json values javascript"
Emmanuel
05 Nov 2017
1var bills = [
2          {
3            "refNo": 17,
4            "billDate": "1-apr-2016",
5            "dueDate": "30-apr-2016",
6            "pendingAmount": 4500,
7            "overdueDays": 28
8          },
9          {
10            "refNo": 20,
11            "billDate": "15-apr-2016",
12            "dueDate": "3-may-2016",
13            "pendingAmount": 56550,
14            "overdueDays": 15
15          }
16        ];
17var res = bills.map(bill => bill.pendingAmount).reduce((acc, bill) => bill + acc);
18console.log(res)