LeetCode solutions

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

Read the problem on LeetCode View on GitHub

JavaScript

Accepted on LeetCode — runtime 48ms, memory 54.3MB, accepted 2025-12-31.

javascript
/**
 * @param {Object|Array} obj
 * @return {boolean}
 */
var isEmpty = function(obj) {
    return Object.keys(obj).length === 0;
};

Source