Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const items = [1,2,3,4,5]
items.reduce((follower, leader) => {
console.log(follower, leader)
return leader
})
// OUTPUTS:
// 1, 2
// 2, 3
// 3, 4
// 4, 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment