Skip to content

Instantly share code, notes, and snippets.

@jboxman
Created February 20, 2016 16:48
Show Gist options
  • Save jboxman/59784d0f55789e36d812 to your computer and use it in GitHub Desktop.
Save jboxman/59784d0f55789e36d812 to your computer and use it in GitHub Desktop.
Ways to return a new object with only specified keys
// Pure JavaScript
var keys = ['name', 'display_name', 'status', 'logo'],
o = {},
k;
while(k = keys.shift()) {o[k] = channel[k]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment