-
-
Save smamran/d85c9c3f25544d739b96 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