Home > @gglib/utils > append

append() function

Pushes an item into the given array. If array is null, a new instance is created

Signature:

export declare function append<T>(list: T[] | null, item: T): T[];

Parameters

Parameter Type Description
list T[] | null the array
item T the item

Returns:

T[]

the given array or a new instance