Skip to content

Instantly share code, notes, and snippets.

@rjz
Forked from fat/gist:1575714
Last active August 29, 2015 14:01
Show Gist options
  • Save rjz/40270076f735deaaf0bd to your computer and use it in GitHub Desktop.
Save rjz/40270076f735deaaf0bd to your computer and use it in GitHub Desktop.
// 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