Checks if the given array is present and it is not empty (contains at least one element).

Type signature

<T>(xs?: T[]) => boolean

Examples

any([]);
// ⇒ false
Try in REPL
any([1, 2, 3]);
// ⇒ true
Try in REPL

Questions

  • How to check if an array is empty?
  • How to check if an array is empty or null or undefined?
  • How to check if an array is empty or not?
  • How to check if an array is empty or doesn't exist?

TypeScript sourceJavaScript source