javascript check if an object is empty Edit

Murugan Andezuthu Dharmaratnam | 16 March 2021 | 55

how to check in javascript if an object is empty

Solution

obj && Object.keys(obj).length === 0 && obj.constructor === Object