I have an object named UserData and in it, there I am trying to get $id but it showing me undefined
const userData = useSelector(state => state.auth.userData) console.log(userData) console.log(userData.$id)
after logging in console
i also tried asking gemini but it said i can try bracket notation
` const userId = userData[‘$id’];
but it was also throwing errors .
it’s just simple java-script and it is not in any Asynchronous function .
Is there any syntax problem or any other possible reason for it ?
All suggestions are welcome
Vivek Dudi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.