ChemPal Documentation - v0.0.13-beta.5
    Preparing search index...
    • Checks if an array is populated.

      Parameters

      • arr: unknown

        The array to check

      Returns arr is unknown[]

      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;
      }