Check if an object is empty in JavaScript
How to check if a JavaScript object is empty despite the absence of a length property.
How to check if a JavaScript object is empty despite the absence of a length property.
Unlike arrays and strings, objects don't have a length property to query.
JavaScript objects are extremely common, but also notoriously difficult to iterate through.
Easily convert a JS object to an array using the Object.entries() method.