Reputation: 23
I have a json data stored in a variable.
Json Data:
var employees = {"emp":{{"firstName":"John"},{"secondName":"John"}}};
From above JSON Data, I should not have emp node. I need JSON Data as
{{"firstName":"John"},{"secondName":"John"}};
How can i remove using Javascript.
Upvotes: 0
Views: 341
Reputation: 68413
if your employee
object is
var employees = {"emp":{"firstName":"John","secondName":"John"}}; //since your original object is not correct
simply do
employees = employees.emp;
Upvotes: 3