functional-augments
Version:
Augment collection prototypes with methods for functional programming, including filter(), map() and reduce().
15 lines (11 loc) • 342 B
JavaScript
const augment = require('./lib/augment')(String);
const common = require('./lib/common');
const iterable = require('./lib/iterable');
augment('mempty', () => '');
augment('mappend', function mappend(v) {
return this + v;
});
augment('reduce', iterable.reduce);
augment('map', common.map);
augment('filter', common.filter);
;