|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
561 bytes
|
| Line | |
|---|
| 1 | import cb from './_cb.js';
|
|---|
| 2 | import isArrayLike from './_isArrayLike.js';
|
|---|
| 3 | import keys from './keys.js';
|
|---|
| 4 |
|
|---|
| 5 | // Return the results of applying the iteratee to each element.
|
|---|
| 6 | export default function map(obj, iteratee, context) {
|
|---|
| 7 | iteratee = cb(iteratee, context);
|
|---|
| 8 | var _keys = !isArrayLike(obj) && keys(obj),
|
|---|
| 9 | length = (_keys || obj).length,
|
|---|
| 10 | results = Array(length);
|
|---|
| 11 | for (var index = 0; index < length; index++) {
|
|---|
| 12 | var currentKey = _keys ? _keys[index] : index;
|
|---|
| 13 | results[index] = iteratee(obj[currentKey], currentKey, obj);
|
|---|
| 14 | }
|
|---|
| 15 | return results;
|
|---|
| 16 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.