Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created November 8, 2013 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tmcw/7373068 to your computer and use it in GitHub Desktop.
Save tmcw/7373068 to your computer and use it in GitHub Desktop.
// using reduce
var team = posts.team.reduce(function(prev, post, index, list) {
prev.push(post.metadata.title);
return prev;
}, []);
// using map
var team = posts.team.map(function(post) {
return post.metadata.title);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment