UNPKG

rc-js-util

Version:

A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.

14 lines 379 B
/** * @public * Like `Array.reduce` but without the requirement to return the value in the callback. * * @remarks * See {@link arrayCollect}. */ export function arrayCollect(items, collected, collect) { for (let i = 0, iEnd = items.length; i < iEnd; ++i) { collect(collected, items[i], i); } return collected; } //# sourceMappingURL=array-collect.js.map