source: frontend/node_modules/underscore/cjs/map.js

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: 582 bytes
Line 
1var _cb = require('./_cb.js');
2var _isArrayLike = require('./_isArrayLike.js');
3var keys = require('./keys.js');
4
5// Return the results of applying the iteratee to each element.
6function 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}
17
18module.exports = map;
Note: See TracBrowser for help on using the repository browser.