|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
397 bytes
|
| Line | |
|---|
| 1 | "use strict";
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
|---|
| 4 | value: true
|
|---|
| 5 | });
|
|---|
| 6 | exports.default = map;
|
|---|
| 7 | function map(values, mapper) {
|
|---|
| 8 | if (typeof values[Symbol.iterator] !== "function") throw new TypeError("values is not iterable");
|
|---|
| 9 | if (typeof mapper !== "function") throw new TypeError("mapper is not a function");
|
|---|
| 10 | return Array.from(values, (value, index) => mapper(value, index, values));
|
|---|
| 11 | } |
|---|
Note:
See
TracBrowser
for help on using the repository browser.