Object Values
Return an array of an object's own enumerable property values.
Usage
var objectValues = require( '@stdlib/utils/values' );
objectValues( obj )
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 ]
Notes
- 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.
Examples
var objectValues = require( '@stdlib/utils/values' );
var obj = {
'beep': 'boop',
'a': {
'b': 'c'
},
'foo': [ 'bar' ]
};
var vals = objectValues( obj );
// e.g., returns [ 'boop', {'b':'c'}, [ 'bar' ] ]