Created
September 7, 2017 09:04
-
-
Save eduzol/44635797f9c5705c41c3dfbb1e9e122b 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
/* Write a Curried Function | |
* | |
* Create a function called "houseBuilder" that should: | |
* - Accept the number of stories (floors) | |
* - Return a function | |
* | |
* The returned function should: | |
* - Accept the color of the house | |
* - Return a string in the following format: | |
* "building a <numOfStories>-story, <color> house" | |
* | |
* Example: | |
* const response = houseBuilder(3)('blue'); | |
* console.log(response); // building a 3-story, blue house | |
*/ | |
var houseBuilder = function ( stories) { | |
return function(color ){ | |
return 'building a ' + stories+'-story, '+color+' house'; | |
}; | |
}; | |
const response = houseBuilder(3)('blue'); | |
console.log(response); // building a 3-story, blue house |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment