const isEmpty = Array.isArray(array) && array.length == 0;
      
      Javascript language logo

      Check if array is empty

      My JavaScript recipes

      The code block checks to see if the array is an array and if it is, it checks to see if the length of the array is zero.

      Shortcut: array.is_empty

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.