I have an object fetched from 3rd party API as shown below:
{
name:\"Luke Skywalker\",
__typename:\"People\",
Symbol(id):\"ROOT_QUERY.people.\"
}
Symbols
were designed to define unique property names to avoid collisions. So you should either have access to the symbol used to construct the object or get all symbols using getOwnPropertySymbols
const obj = {
[Symbol('id')]: 1
}
console.log(obj[Symbol('id')])
const symbols = Object.getOwnPropertySymbols(obj)
console.log(obj[symbols[0]])