Skip to content

Instantly share code, notes, and snippets.

@sktwentysix
Created June 9, 2022 12:17
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