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().
Symbol properties are completely invisible to Object.keys, Object.values, and Object.entries.
Challenge: Implement onlyStringKeyCount(obj) that returns the number of string keys using Object.keys, demonstrating that Symbols are not counted.
const s = Symbol('x')
onlyStringKeyCount({ a: 1, [s]: 2 }) // β 1 (symbol not counted)