I have a small snippet that I'm trying to use for the verification of an empty array. Basically, it should check if there's at least one element in the array. If there is one, returns false, otherwise true.
Is this the most optimized way to create this function?
type EmptyArr<T extends any[]> = T['length'] extends 0 ? true : false
type E1 = [1,2,3] //false
type E2 = [] //true
type T1 = EmptyArr<E1>