Object.getOwnPropertySymbolsbeginner// Get all Symbol-keyed properties
const sym = Symbol('id')
const obj = { [sym]: 1, name: 'Alice' }
Object.getOwnPropertySymbols(obj) // β [Symbol(id)]Use Object.getOwnPropertySymbols() to retrieve all symbol-keyed own properties, which are invisible to Object.keys().
When an object has no Symbol-keyed properties, Object.getOwnPropertySymbols returns an empty array.
Challenge: Implement hasSymbols(obj) that returns true if the object has any Symbol keys.
hasSymbols({ a: 1 }) // β false
hasSymbols({ [Symbol('x')]: 1 }) // β true