Answers for "sum of all duplicate values in an array typescript"

2

typescript sum all array values

const sum = receiptItems.reduce((sum, current) => sum + current.total, 0);
Posted by: Guest on November-16-2020
0

how to count duplicates in an array javascript

arr.reduce((b,c)=>((b[b.findIndex(d=>d.el===c)]||b[b.push({el:c,count:0})-1]).count++,b),[]);
Posted by: Guest on December-16-2020

Code answers related to "sum of all duplicate values in an array typescript"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language