Instantly share code, notes, and snippets.

@peeke /box.es6
Created May 22, 2017

Embed
What would you like to do?
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