Mehul Lakhanpal Posted on Aug 11, 2020 Check if an object is empty #javascript #beginners Top comments (5) Subscribe Personal Trusted User Create template Templates let you quickly answer FAQs or store snippets for re-use. Submit Preview Dismiss Collapse Expand pentacular pentacular pentacular Follow Joined Jul 8, 2020 • Aug 11 '20 Dropdown menu Copy link Hide When would you ever want to test for this? Collapse Expand Mehul Lakhanpal Mehul Lakhanpal Mehul Lakhanpal Follow Full-stack Developer | Built QuickSwitch, Array Builder, FileOps Email 318097@gmail.com Location Bangalore Work Full stack developer Joined Apr 20, 2019 • Aug 11 '20 Dropdown menu Copy link Hide I don't know. Depends on the situation. Collapse Expand pentacular pentacular pentacular Follow Joined Jul 8, 2020 • Aug 12 '20 Dropdown menu Copy link Hide Can you think of a situation where it would be the reasonable thing to do? :) Collapse Expand Sumukhesh Sumukhesh Sumukhesh Follow A software newbie willing to learn, create and contribute to the ever growing dev community. Location Hyderabad Joined May 9, 2020 • Aug 11 '20 Dropdown menu Copy link Hide One situation i can think of is to use this a validation for data in forms. pentacular pentacular pentacular Follow Joined Jul 8, 2020 • Aug 12 '20 Dropdown menu Copy link Hide l don't think that makes sense. When validating you would want to check the requirements for that form, not that it was an empty object. Code of Conduct • Report abuse Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse
Top comments (5)
When would you ever want to test for this?
I don't know. Depends on the situation.
Can you think of a situation where it would be the reasonable thing to do? :)
One situation i can think of is to use this a validation for data in forms.
l don't think that makes sense.
When validating you would want to check the requirements for that form, not that it was an empty object.