Skip to content

Instantly share code, notes, and snippets.

@mrroot5
Created May 22, 2015 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrroot5/cbc984ba6d168f393a8c to your computer and use it in GitHub Desktop.
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
// 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