Created
February 20, 2016 16:48
-
-
Save jboxman/59784d0f55789e36d812 to your computer and use it in GitHub Desktop.
Ways to return a new object with only specified keys
This file contains 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
// 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