You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
381 B
15 lines
381 B
import isArrayLike from './is-array-like';
|
|
var map = function (arr, func) {
|
|
if (!isArrayLike(arr)) {
|
|
// @ts-ignore
|
|
return arr;
|
|
}
|
|
var result = [];
|
|
for (var index = 0; index < arr.length; index++) {
|
|
var value = arr[index];
|
|
result.push(func(value, index));
|
|
}
|
|
return result;
|
|
};
|
|
export default map;
|
|
//# sourceMappingURL=map.js.map
|