const user = {};
      Object.entries(user).length === 0; // true
      const bird = {
          name: 'Penguin',
          avatar: 'p''
      };
      Object.entries(bird).length === 0; // false
      

      Javascript language logo
      Check if an object is empty

      check
      object
      empty
      ...
      Javascript recipes

      Using Object.entries() Method

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.