Created
May 22, 2017 07:32
-
-
Save peeke/d1ad1619621b54d441a1384576ccc75c to your computer and use it in GitHub Desktop.
The box pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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