copy

copy

Returns a shallow copy version an array

Import

import { copy } from '@fullstacksjs/toolbox';

Signature

function copy<T extends any[]>(arr: T): T {}

Examples

copy([])  // []
copy([1]) // [1]