Created
December 9, 2010 13:35
-
-
Save acrosa/734709 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
var capitalize = function(text){ | |
return text[0].toUpperCase() + text.substring(1, text.length); | |
} | |
var buildHtml = function(phrase){ | |
return "<h1>"+ phrase +"</h1>"; | |
} | |
// We compose the preceding functions into a new one | |
var buildTitle = _.compose(capitalize, buildHtml); | |
buildTitle("Title of the page") | |
=> "<h1>Title of the page</h1>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment