11 lines
213 B
JavaScript
11 lines
213 B
JavaScript
var p = require("pararr");
|
|
//var p = new Parallel([1, 2]);
|
|
|
|
square = (num)=>([1, Math.pow(num, 2)]);
|
|
merge = ([a, b])=>(a.concat(b));
|
|
|
|
p.map([1, 2, 3], square, (err, data)=>{
|
|
console.log(data);
|
|
p.destroy();
|
|
});
|