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.

20 lines (19 loc) 306 B
/** * @public * Adds the items in an array to the set. * * @remarks * See {@link arrayAddToSet}. */ export function arrayAddToSet<TItem> ( items: ArrayLike<TItem>, set: Set<TItem> ) : void { for (let i = 0, iEnd = items.length; i < iEnd; ++i) { set.add(items[i]); } }