Created
January 11, 2017 03:54
-
-
Save SherryH/8ccbcbe8949088e39d3a8a80c3d949e7 to your computer and use it in GitHub Desktop.
Currying
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
var player = function (type) { | |
return function(song){ | |
console.log('I can play '+song+' on '+ type); | |
} | |
} | |
var guitarPlayer = player('guitar'); | |
guitarPlayer('Country Road'); | |
var pianoPlayer = player('piano'); | |
pianoPlayer('Under the Sea'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment