Skip to content

Instantly share code, notes, and snippets.

@peeke
Created May 22, 2017 07:32
Show Gist options
  • Save peeke/d1ad1619621b54d441a1384576ccc75c to your computer and use it in GitHub Desktop.
Save peeke/d1ad1619621b54d441a1384576ccc75c to your computer and use it in GitHub Desktop.
The box pattern
// The box pattern:
// Array chaining methods for single values
const box = v => [ v ]
box(1)
.map(n => n * 2)
.map(n => n + 2)
.pop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment