I have 1 object coming from a server with several properties in which I want to remove it into a new object, changing the name of property 1 and saving the rest.
the code:
JSON: { UserId: 1, Name: "Woo", Age: 10 }
The format of the object in which I want:
var newObj = {} newObj.id = jsonObj.UserId;
What I'm doing is based on this answer , trying to parse some json in a format that requires me to change the name of property 1.
Shawn mclean
source share