-
-
Save yaroslavya/4719375 to your computer and use it in GitHub Desktop.
Answer to https://gist.github.com/rmurphey/576723 for say('Hello')('world!'); question, but in a very custom way.
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 say(a){ | |
var inner = function(b){ | |
return say(a+b); | |
}; | |
inner.toString = function(){ | |
return a; | |
}; | |
return inner; | |
} | |
console.log(say('h'));/will log h | |
console.log(say('hello')('world');//will log helloworld | |
console.log(say('h')('e')('l')('l')('o')(' ')('w')('o')('r')('l')('d')('!'));//you know what it will do ;-) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment