Skip to content

Instantly share code, notes, and snippets.

@vitaly-t
Created November 13, 2022 23:07
Show Gist options
  • Save vitaly-t/2c28051e443ae83146f40a7d3e6f0569 to your computer and use it in GitHub Desktop.
Save vitaly-t/2c28051e443ae83146f40a7d3e6f0569 to your computer and use it in GitHub Desktop.
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