const a = Symbol() const obj1 = { [a]: 1 } const obj2 = {b: 2} const obj3 = {} Object.defineProperty(obj3, 'a', { value: 1, enumerable: false }) const obj4 = {} console.log(Reflect.ownKeys(obj1).length === 0) // false console.log(Reflect.ownKeys(obj2).length === 0) // false console.log(Reflect.ownKeys(obj3).length === 0) // false console.log(Reflect.ownKeys(obj4).length === 0) // true 扩展阅读 @【JS面试】JS中如何判断一个对象是空对象 如何在 JavaScript 中检查对象是否为空