Skip to content

Instantly share code, notes, and snippets.

@glennreyes
Created October 27, 2018 14:13
Show Gist options
  • Save glennreyes/201e0f154bd45a1ff8d0480bd66b4ee9 to your computer and use it in GitHub Desktop.
Save glennreyes/201e0f154bd45a1ff8d0480bd66b4ee9 to your computer and use it in GitHub Desktop.
const say = (str) => {
let result = str;
const next = (nextStr) => {
if (!nextStr) return result
result += ` ${nextStr}`;
return next
}
return next
};
console.log(say('Hello')('World')())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment