Created
November 13, 2022 23:09
-
-
Save vitaly-t/129f82dc80a529f6ef7c8f334d1cdfc6 to your computer and use it in GitHub Desktop.
This file contains 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, 5)); | |
console.log(...i); //=> 11 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment