Skip to content

Instantly share code, notes, and snippets.

@bayleedev
Created April 20, 2017 22:45
Show Gist options
  • Save bayleedev/9da3dd6f86ce71c78aba4742d5884432 to your computer and use it in GitHub Desktop.
Save bayleedev/9da3dd6f86ce71c78aba4742d5884432 to your computer and use it in GitHub Desktop.
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