Arrays.clear()

Syntax

function clear<T>(array: T[]): T[]

Clears all elements from the given array.

Parameters
array

The array you want to clear.

Example

import { Arrays } from 'potence';

const array = [5, 3, 2];

Arrays.clear(array);

console.log(array);   // -> []

Remarks

This function returns the original array, not a new one.