Skip to content

Instantly share code, notes, and snippets.

@jasonblanchard
Last active July 6, 2016 13:24
Show Gist options
  • Save jasonblanchard/81a204670c58f1990e66926756e7cd59 to your computer and use it in GitHub Desktop.
Save jasonblanchard/81a204670c58f1990e66926756e7cd59 to your computer and use it in GitHub Desktop.
Functional example jawn
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