UNPKG
concat-map
Version:
latest (0.0.2)
0.0.2
0.0.1
0.0.0
concatenative mapdashery
github.com/ljharb/concat-map
ljharb/concat-map
concat-map
/
example
/
map.js
9 lines
(7 loc)
•
179 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
'use strict'
;
var
concatMap =
require
(
'../'
);
var
xs = [
1
,
2
,
3
,
4
,
5
,
6
];
var
ys =
concatMap
(xs,
function
(
x
) {
return
x %
2
? [x -
0.1
, x, x +
0.1
] : []; });
console
.
dir
(ys);