# Proposal: \`Object.isEmpty(target)\`

**URL:** <https://es.discourse.group/t/proposal-object-isempty-target/2470>\
**Category:** 💡 Ideas\
**Tags:** proposal\
**Created:** [November 20, 2025, 2:41am UTC](https://es.discourse.group/t/proposal-object-isempty-target/2470 "2025-11-20T02:41:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![geekdroid07](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/geekdroid07/32/2570_2.png) [@geekdroid07](https://es.discourse.group/u/geekdroid07)\
**Post date:** [November 20, 2025, 2:41am UTC](https://es.discourse.group/t/proposal-object-isempty-target/2470/1 "2025-11-20T02:41:02Z")

</div>

Add **`Object.isEmpty(value)`** to return **`true`** only when **`value`** has zero own string or symbol keys (otherwise **`false`** , primitives throw). The repository contains the reference implementation, polyfill helper, documentation, and tests to explore adding this built-in to JavaScript.

**Motivation and examples**

- Avoid verbose patterns (**`Object.keys(obj).length === 0`**, etc.) that miss symbol keys or objects without prototypes.

- Provide a clear primitive that engines can optimize, aligning with other **`Object.*`** utilities. \*

```javascript
js

```

```javascript
Object.isEmpty({}); // true
Object.isEmpty({ a: 1 }); // false
Object.isEmpty(Object.create(null)); // true
Object.isEmpty(Symbol("x")); // TypeError

```

**Repository link**  
**[https://github.com/geekdroid07/object-is-empty](https://github.com/geekdroid07/object-is-empty)**

**Open questions for feedback**

1. Should primitives be coerced with **`ToObject`** (like **`Object.keys`** ) or should the method throw to surface bugs?

2. Is the name **`Object.isEmpty`** ideal, or should we consider alternatives such as **`Object.isEmptyObject`**?

3. What optimizations or exotic-object behaviors (e.g., proxies, host objects) should be specified explicitly?

---

<div class="post-metadata">

**Author:** ![bakkot](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/bakkot/32/22_2.png) [@bakkot](https://es.discourse.group/u/bakkot)\
**Post date:** [November 20, 2025, 2:52am UTC](https://es.discourse.group/t/proposal-object-isempty-target/2470/2 "2025-11-20T02:52:01Z")

</div>

There is [a brand new proposal](https://github.com/tc39/proposal-object-keys-length) for giving the _number_ of keys, which would cover this. You may be interested in following along there.
