isEmpty() Overview Checks if an object or array is empty. Code const isEmpty = (obj) => Array.isArray(obj) ? obj.length === 0 : Object.keys(obj).length === 0;