Last active
September 7, 2018 14:52
-
-
Save theredfish/127957ffd90639c361e1038faac0bd4e to your computer and use it in GitHub Desktop.
Composition in js
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 display_param(fn, param) { | |
console.log(fn(param)); | |
} | |
function add_x_to_param(param) { | |
return param+"x"; | |
} | |
display_param(add_x_to_param, "yolo_swag_"); |
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 display (fn) { | |
console.log(fn()); | |
} | |
let get_param_x = function() { | |
return "yolo_swag_x"; | |
} | |
display(get_param_x); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment