strom/samples/reduce.js

6 lines
163 B
JavaScript
Raw Normal View History

2018-12-03 05:38:17 +00:00
const Mhysa = require("mhysa");
Mhysa.fromArray(["a", "b", "cc"])
.pipe(Mhysa.reduce((acc, s) => ({ ...acc, [s]: s.length }), {}))
.pipe(process.stdout);