The array to check
True if the array is populated, false otherwise
isPopulatedArray([1, 2, 3]) // Returns true
isPopulatedArray([]) // Returns false
export function isPopulatedArray(arr: unknown): arr is unknown[] {
return Array.isArray(arr) === true && arr.length > 0;
}
Checks if an array is populated.