Created
March 13, 2018 04:59
-
-
Save haingdc/011892aef1b67a9afa59bf5ad6ca2b41 to your computer and use it in GitHub Desktop.
A Gentle Introduction to Functional JavaScript: Part 3
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
var twinkle = function(noun, wonderAbout) { | |
return 'Twinkle, twinkle, little ' + | |
noun + '\nHow I wonder where you ' + | |
wonderAbout; | |
} | |
// fix-cứng noun | |
var twinkleBat = partial(twinkle, 'bat'); | |
twinkleBat('are at'); // Twinkle, twinkle, little bat\nHow I wonder where you are at | |
// fix-cứng noun và wonderAbout - áp dụng toàn phần/hard-coded! | |
var twinkleStar = partial(twinkle, 'star', 'are'); | |
twinkleStar(); // Twinkle, twinkle, little star\nHow I wonder where you are |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment