Code to go logo
Created using Figma
Use Cases
Contribute
How to check if object is empty in JavaScript
DOM
By Jad Joubran ·
Last updated Feb 27, 2024
const obj = {}; const isEmpty = Object.keys(obj).length === 0;
true
Feb 27, 2024
1
Jad Joubran
See answer
1
Jad Joubran
Object.keys
on MDN
Learn JavaScript step by step
Related use cases
How to pause audio in JavaScript
How to stop audio in JavaScript