Last active
July 6, 2016 13:24
-
-
Save jasonblanchard/81a204670c58f1990e66926756e7cd59 to your computer and use it in GitHub Desktop.
Functional example jawn
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
function createPerson(attribute) { | |
var attributes = [attribute]; | |
return function inner(attribute) { | |
if (!attribute) { | |
return attributes; | |
} | |
attributes.push(attribute); | |
return inner; | |
}; | |
} | |
var jeff = createPerson('beards')('little doggies')('guitarz')(); | |
console.log("Jeff likes " + jeff.join(', ')); // "Jeff likes beards, little doggies, guitarz" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment