strom/samples/reduce.js
2018-12-03 00:38:17 -05:00

6 lines
163 B
JavaScript

const Mhysa = require("mhysa");
Mhysa.fromArray(["a", "b", "cc"])
.pipe(Mhysa.reduce((acc, s) => ({ ...acc, [s]: s.length }), {}))
.pipe(process.stdout);