MCPcopy
hub / github.com/ternjs/tern / map

Function map

test/cases/simple_generic.js:6–10  ·  view source on GitHub ↗
(arr, f)

Source from the content-addressed store, hash-verified

4last(["a", "b", "c"]); //: string
5
6function map(arr, f) {
7 var res = [];
8 for (var i = 0; i < arr.length; ++i) res.push(f(arr[i]));
9 return res;
10}
11
12map([1, 2, 3], function() { return "X"; }); //: [string]
13map([1, 2, 3], function() { return true; }); //: [bool]

Callers 1

simple_generic.jsFile · 0.85

Calls 1

fFunction · 0.70

Tested by

no test coverage detected