Created
May 22, 2015 17:14
-
-
Save mrroot5/cbc984ba6d168f393a8c to your computer and use it in GitHub Desktop.
Retorna los valores de un objeto dentro de un array.
FROM: http://stackoverflow.com/questions/20881213/converting-json-object-into-javascript-array
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
// Return an array | |
function get_object_values(obj) { | |
'use strict'; | |
return Object.keys(obj).map(function (k) { | |
return obj[k]; | |
}); | |
} | |
var object_values = get_object_values({key1: "value1", key2: "value2", key3: "value3"}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment