I have a json that is something like this:
user =
{
"info": {
"id": "....",
......
},
......
}
So.. i can get the id using user.info.id
but i need a function that can give me a property of an object using something like getInfo(user, "info.id")
i already tried my luck with user["info.id"]
.
Has JavaScript already got something like this? Or, how can i implement this?
BTW, I'm using node.js :)