mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Fix typo in _.toArray and tweak _.forEach documentation.
Former-commit-id: 6417e50be9381a4ecede54868a9c2c41dabca4f2
This commit is contained in:
@@ -620,7 +620,7 @@
|
||||
if (func && func.prototype) {
|
||||
// ensure `new bound` is an instance of `bound` and `func`
|
||||
noop.prototype = func.prototype;
|
||||
bound.prototype = new noop
|
||||
bound.prototype = new noop;
|
||||
noop.prototype = null;
|
||||
}
|
||||
return bound;
|
||||
@@ -2114,7 +2114,7 @@
|
||||
* // => alerts each number and returns '1,2,3'
|
||||
*
|
||||
* _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, alert);
|
||||
* // => alerts each number (order is not guaranteed)
|
||||
* // => alerts each number value (order is not guaranteed)
|
||||
*/
|
||||
var forEach = createIterator(forEachIteratorOptions);
|
||||
|
||||
@@ -2595,8 +2595,8 @@
|
||||
function toArray(collection) {
|
||||
var length = collection ? collection.length : 0;
|
||||
if (typeof length == 'number') {
|
||||
return noCharByIndex && isString(array)
|
||||
? array.split('')
|
||||
return noCharByIndex && isString(collection)
|
||||
? collection.split('')
|
||||
: slice(collection);
|
||||
}
|
||||
return values(collection);
|
||||
|
||||
Reference in New Issue
Block a user