Add ES6 notes to _.keys, _.keysIn, _.values, & _.valuesIn. [ci skip]

This commit is contained in:
John-David Dalton
2015-01-02 13:33:55 -06:00
parent 0d1c7a1414
commit 30b1445195

View File

@@ -8639,6 +8639,10 @@
/** /**
* Creates an array of the own enumerable property names of `object`. * Creates an array of the own enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects. See the
* [ES6 spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys)
* for more details.
*
* @static * @static
* @memberOf _ * @memberOf _
* @category Object * @category Object
@@ -8655,6 +8659,9 @@
* *
* _.keys(new Shape); * _.keys(new Shape);
* // => ['x', 'y'] (iteration order is not guaranteed) * // => ['x', 'y'] (iteration order is not guaranteed)
*
* _.keys('hi');
* // => ['0', '1']
*/ */
var keys = !nativeKeys ? shimKeys : function(object) { var keys = !nativeKeys ? shimKeys : function(object) {
if (object) { if (object) {
@@ -8671,6 +8678,8 @@
/** /**
* Creates an array of the own and inherited enumerable property names of `object`. * Creates an array of the own and inherited enumerable property names of `object`.
* *
* **Note:** Non-object values are coerced to objects.
*
* @static * @static
* @memberOf _ * @memberOf _
* @category Object * @category Object
@@ -9037,6 +9046,8 @@
/** /**
* Creates an array of the own enumerable property values of `object`. * Creates an array of the own enumerable property values of `object`.
* *
* **Note:** Non-object values are coerced to objects.
*
* @static * @static
* @memberOf _ * @memberOf _
* @category Object * @category Object
@@ -9053,6 +9064,9 @@
* *
* _.values(new Shape(2, 1)); * _.values(new Shape(2, 1));
* // => [2, 1] (iteration order is not guaranteed) * // => [2, 1] (iteration order is not guaranteed)
*
* _.values('hi');
* // => ['h', 'i']
*/ */
function values(object) { function values(object) {
return baseValues(object, keys(object)); return baseValues(object, keys(object));
@@ -9062,6 +9076,8 @@
* Creates an array of the own and inherited enumerable property values * Creates an array of the own and inherited enumerable property values
* of `object`. * of `object`.
* *
* **Note:** Non-object values are coerced to objects.
*
* @static * @static
* @memberOf _ * @memberOf _
* @category Object * @category Object