I'm struggling to figure out how to properly iterate through this JSON object using only JavaScript. My goal is to store the token in one variable and the user details in separate variables.
Here's the JSON object:
{
"token": "517b27a84a4d373a636e323a9572a0ab43883291",
"user": {
"credential_id":"1",
"name":"name",
"password":"password",
"age":"25",
"email":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2a414b464b53... [email protected]</a>",
"img_src":"043008thmy.jpg",
"user_type":"0",
"username":"kalay"
}
}