-
-
Save rjz/40270076f735deaaf0bd 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
// require hogan | |
var hogan = require("hogan.js"); | |
// compile template | |
var template = hogan.compile("@{{name}}"); | |
var team = ['dhg', 'fat', 'jimio', 'nickgreen', 'sayrer']; | |
var mappedTeam = team.map(function (twitterer) { | |
// Render context to template | |
return template.render({name: twitterer }); | |
}); | |
// outputs "Follow: @dhg @fat @jimio @nickgreen @sayrer!" | |
console.log('Follow: ' + mappedTeam.join(' ') + '!'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment