Created
June 9, 2022 12:17
-
-
Save sktwentysix/3b5d8f9ed63d65ea88c03a2fa621a98d to your computer and use it in GitHub Desktop.
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 array = [1,5,3,9,6,2,4] | |
const reducerCallback = (prevItem, currItem) => { | |
return prevItem + currItem | |
} | |
console.log(array.reduce(reducerCallback)) // 30 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment