Last active
September 3, 2018 12:05
-
-
Save travishen/de351f3e3aacc6c71a76211d71201a47 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 greet(whattosay) { | |
return function(name) { | |
consoel.log(whattosay + ' ' + name); // include variable whattosay by scope chain | |
} | |
} | |
greet('Hello')('John'); // 'Hello John' | |
var sayHi = greet('Hi'); | |
sayHi('Tony'); // 'Hi Tony' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment