Skip to content

Instantly share code, notes, and snippets.

@brunokiafuka
Created May 29, 2020 20:38
Show Gist options
  • Save brunokiafuka/c1eda8e059632142102c95635b198787 to your computer and use it in GitHub Desktop.
Save brunokiafuka/c1eda8e059632142102c95635b198787 to your computer and use it in GitHub Desktop.
reduce json obj arr
const array1 = [{num: 1}, {num: 1}, {num: 1}, {num: 1}];
console.log(array1.reduce((count, item) => {
return count += item.num;
},0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment