main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
731 bytes
|
Rev | Line | |
---|
[d565449] | 1 | import baseValues from './_baseValues.js';
|
---|
| 2 | import keys from './keys.js';
|
---|
| 3 |
|
---|
| 4 | /**
|
---|
| 5 | * Creates an array of the own enumerable string keyed property values of `object`.
|
---|
| 6 | *
|
---|
| 7 | * **Note:** Non-object values are coerced to objects.
|
---|
| 8 | *
|
---|
| 9 | * @static
|
---|
| 10 | * @since 0.1.0
|
---|
| 11 | * @memberOf _
|
---|
| 12 | * @category Object
|
---|
| 13 | * @param {Object} object The object to query.
|
---|
| 14 | * @returns {Array} Returns the array of property values.
|
---|
| 15 | * @example
|
---|
| 16 | *
|
---|
| 17 | * function Foo() {
|
---|
| 18 | * this.a = 1;
|
---|
| 19 | * this.b = 2;
|
---|
| 20 | * }
|
---|
| 21 | *
|
---|
| 22 | * Foo.prototype.c = 3;
|
---|
| 23 | *
|
---|
| 24 | * _.values(new Foo);
|
---|
| 25 | * // => [1, 2] (iteration order is not guaranteed)
|
---|
| 26 | *
|
---|
| 27 | * _.values('hi');
|
---|
| 28 | * // => ['h', 'i']
|
---|
| 29 | */
|
---|
| 30 | function values(object) {
|
---|
| 31 | return object == null ? [] : baseValues(object, keys(object));
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | export default values;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.