source: frontend/node_modules/underscore/amd/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: 573 bytes
Line 
1define(['./_cb', './_isArrayLike', './keys'], function (_cb, _isArrayLike, keys) {
2
3 // Return the results of applying the iteratee to each element.
4 function map(obj, iteratee, context) {
5 iteratee = _cb(iteratee, context);
6 var _keys = !_isArrayLike(obj) && keys(obj),
7 length = (_keys || obj).length,
8 results = Array(length);
9 for (var index = 0; index < length; index++) {
10 var currentKey = _keys ? _keys[index] : index;
11 results[index] = iteratee(obj[currentKey], currentKey, obj);
12 }
13 return results;
14 }
15
16 return map;
17
18});
Note: See TracBrowser for help on using the repository browser.