addArrayItems()function

addArrayItems(arr: MutableArray<T>, ...items: T[]): void
ParamType
arrMutableArray<T>
The array to add to (modified in place). required
itemsT[]
The items to add. required

Add multiple items to an array (by reference).

  • Skip items that already exist.

Examples

addArrayItems(arr, 3, 4); // (`arr` now contains `3` and `4`)