mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Move internal modules to “internal” folder.
This commit is contained in:
20
.internal/arrayMap.js
Normal file
20
.internal/arrayMap.js
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* A specialized version of `map` for arrays.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} [array] The array to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Array} Returns the new mapped array.
|
||||
*/
|
||||
function arrayMap(array, iteratee) {
|
||||
let index = -1;
|
||||
const length = array == null ? 0 : array.length;
|
||||
const result = Array(length);
|
||||
|
||||
while (++index < length) {
|
||||
result[index] = iteratee(array[index], index, array);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
export default arrayMap;
|
||||
Reference in New Issue
Block a user