Closed jonahsnider closed 3 years ago
Check whether an array is empty. Helpful type guard to have since TypeScript array type definitions aren't very safe.
declare function isEmpty(array: readonly unknown[]): array is []; isEmpty([1, 2, 3]); //=> false isEmpty([]); //=> true
Thanks :)
Check whether an array is empty. Helpful type guard to have since TypeScript array type definitions aren't very safe.