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
// Another Simple example | |
// Simplest compose | |
var compose = function(f, g) { | |
return function(x) { | |
return f(g(x)); | |
}; | |
}; | |
var add1 = function(x) {return x + 1;}; |
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
// Simple compose example (extract from Scott Sauyet) | |
// Simplest compose | |
var compose = function(f, g) { | |
return function(x) { | |
return f(g(x)); | |
}; | |
}; | |
var trim = function(str) {return str.replace(/^\s*|\s*$/g, '');}; | |
var capitalize = function(str) {return str.toUpperCase();}; |
NewerOlder