Skip to content

Instantly share code, notes, and snippets.

View alvieirajr's full-sized avatar

Antônio Vieira alvieirajr

  • Brazil, Recife
View GitHub Profile
// Another Simple example
// Simplest compose
var compose = function(f, g) {
return function(x) {
return f(g(x));
};
};
var add1 = function(x) {return x + 1;};
// 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();};