GitHub 6248★

Empty an array

JavaScript version

const empty = (arr) => (arr.length = 0);

// Or
arr = [];

TypeScript version

const empty = <T,_>(arr: T[]) => (arr.length = 0);

// Or
arr = [];
Follow me on and to get more useful contents.