Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80742 views
1
var baseValues = require('../internal/baseValues'),
2
keys = require('./keys');
3
4
/**
5
* Creates an array of the own enumerable property values of `object`.
6
*
7
* **Note:** Non-object values are coerced to objects.
8
*
9
* @static
10
* @memberOf _
11
* @category Object
12
* @param {Object} object The object to query.
13
* @returns {Array} Returns the array of property values.
14
* @example
15
*
16
* function Foo() {
17
* this.a = 1;
18
* this.b = 2;
19
* }
20
*
21
* Foo.prototype.c = 3;
22
*
23
* _.values(new Foo);
24
* // => [1, 2] (iteration order is not guaranteed)
25
*
26
* _.values('hi');
27
* // => ['h', 'i']
28
*/
29
function values(object) {
30
return baseValues(object, keys(object));
31
}
32
33
module.exports = values;
34
35