Created
November 13, 2022 23:07
-
-
Save vitaly-t/2c28051e443ae83146f40a7d3e6f0569 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {pipe, reduce} from 'iter-ops'; | |
const m = new Map<string, number>(); | |
m.set('one', 1); | |
m.set('two', 2); | |
m.set('three', 3); | |
const i = pipe(m.values(), reduce((a, c) => a + c)); | |
console.log(...i); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment