Joined April 2019
·

oliveryoung

it doesn't work if it comes:

let obj2 = {
    [Symbol('name')]: 'alice'
}

let obj3 = Object.defineProperty({}, 'name', {
    value: 'alice',
    enumerable: false
})

i think we can use this:

const isEmptyObj = object => !Object.getOwnPropertySymbols(object).length && !Object.getOwnPropertyNames(object).length
Achievements
1 Karma
0 Total ProTip Views