time-to-botec/squiggle/node_modules/@stdlib/utils/values/README.md
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

1.8 KiB

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 an object'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' ] ]