Created
May 29, 2020 20:38
-
-
Save brunokiafuka/c1eda8e059632142102c95635b198787 to your computer and use it in GitHub Desktop.
reduce json obj arr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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