Check if an array is empty

JavaScript version
// `arr` is an array
const isEmpty = (arr) => !Array.isArray(arr) || arr.length === 0;
TypeScript version
const isEmpty = <T,_>(arr: T[]): boolean => !Array.isArray(arr) || arr.length === 0;
Examples
isEmpty([]); // true
isEmpty([1, 2, 3]); // false