Add doc note to _.zip about unzipping values. [ci skip] [closes #418]

This commit is contained in:
John-David Dalton
2013-12-03 20:40:15 -08:00
parent 326a3c5932
commit 783c165201
2 changed files with 51 additions and 44 deletions

View File

@@ -1803,7 +1803,7 @@
/**
* Gets the appropriate "indexOf" function. If the `_.indexOf` method is
* customized, this method returns the custom method, otherwise it returns
* customized this method returns the custom method, otherwise it returns
* the `baseIndexOf` function.
*
* @private
@@ -5411,9 +5411,10 @@
}
/**
* Creates an array of grouped elements, the first of which contains the first
* elements of the given arrays, the second of which contains the second
* elements of the given arrays, and so on.
* Creates an array of grouped elements, the first of which contains the
* first elements of the given arrays, the second of which contains the second
* elements of the given arrays, and so on. If a zipped value is provided its
* corresponding unzipped value will be returned.
*
* @static
* @memberOf _
@@ -5425,6 +5426,9 @@
*
* _.zip(['fred', 'barney'], [30, 40], [true, false]);
* // => [['fred', 30, true], ['barney', 40, false]]
*
* _.unzip([['fred', 30, true], ['barney', 40, false]]);
* // => [['fred', 'barney'], [30, 40], [true, false]]
*/
function zip() {
var array = arguments.length > 1 ? arguments : arguments[0],