Created
September 22, 2015 00:21
-
-
Save coreyc/b0e82d21b2293f0b3fd1 to your computer and use it in GitHub Desktop.
functional way to get values from object keys
This file contains hidden or 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
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