Skip to content

Instantly share code, notes, and snippets.

@return-none
Created June 18, 2013 17:48
Show Gist options
  • Save return-none/5807651 to your computer and use it in GitHub Desktop.
Save return-none/5807651 to your computer and use it in GitHub Desktop.
underscore can do it
var some_json = [
{
id: 1,
title: 'first_element',
other: 'i dont need it',
},
{
id: 2,
title: 'secont_element',
other: 'i dont need it',
}
];
_.map(some_json, function(e) {
return _.pick(e, 'id', 'title');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment