2864. Is Object Empty
My accepted JavaScript solution to LeetCode problem 2864, Is Object Empty, running in 48ms.
- Difficulty: Easy
- JavaScript
- Runtime 48ms
- Memory 54.3MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
JavaScript
Accepted on LeetCode — runtime 48ms, memory 54.3MB, accepted 2025-12-31.
/**
* @param {Object|Array} obj
* @return {boolean}
*/
var isEmpty = function(obj) {
return Object.keys(obj).length === 0;
};