import {INSERT_TYPE_PUSH, insertValues} from '../internal/array/insert'; // #region Functions /** * Push items into an array _(at the end)_ * * _(Uses chunking to avoid call stack size being exceeded)_ * * @param array Original array * @param pushed Pushed items * @returns New length of the array * * @example * ```typescript * push([1, 2, 3], [4, 5]); // => 5 (new length); array becomes [1, 2, 3, 4, 5] * ``` */ export function push(array: Item[], pushed: Item[]): number { return insertValues(INSERT_TYPE_PUSH, array, pushed, array.length, 0) as number; } // #endregion