Return an array of an object's own enumerable property values.
var objectValues = require( '@stdlib/utils/object-values' );
Returns an array
of an object's own enumerable property values.
var obj = {
'a': 1,
'b': 2
};
var vals = objectValues( obj );
// e.g., returns [ 1, 2 ]
- Value order is not guaranteed, as
object
key enumeration is not specified according to the ECMAScript specification. In practice, however, most engines use insertion order to sort anobject
's keys, thus allowing for deterministic extraction.
var objectValues = require( '@stdlib/utils/object-values' );
var obj = {
'beep': 'boop',
'a': {
'b': 'c'
},
'foo': [ 'bar' ]
};
var vals = objectValues( obj );
// e.g., returns [ 'boop', {'b':'c'}, [ 'bar' ] ]