Skip to content

Instantly share code, notes, and snippets.

@coreyc
Created September 22, 2015 00:21
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 coreyc/b0e82d21b2293f0b3fd1 to your computer and use it in GitHub Desktop.
Save coreyc/b0e82d21b2293f0b3fd1 to your computer and use it in GitHub Desktop.
functional way to get values from object keys
var inputObject = { 0: 'a', 1: 'b', 2: 'c' };
var values = [];
Object.keys(inputObject).forEach(function(key) {
values.push(inputObject[key]);
return values;
});
console.log(values);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment