Oliver2000
asked on
Get specific item from object in javascript without knowing the name of the object inside my object?
I would like to get the value of "name" from the example json object below without knowing the name of the object (123) because this could be anything and I dont know before.
I know it dont work like this but I look for something like
console.log(object[0].name );
to make it more clear.
{
"123": {
"email": "kato@firebase.com",
"name": "Kato"
}
}
I know it dont work like this but I look for something like
console.log(object[0].name
to make it more clear.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Both solutions work fine for me but the second solution is best for me since I have some cases with more than 1 result.