hello friends i want to rename my JSON key so below i my code
var json = '[{"Status":"Success","Data":[{"UserID":null,"UserName":null,"EmailID":null,"EmailIDExists":false,"Active":null,"Country":null,"WishListID":"31","WishListName":"General","WishListItems":[{"WishListItemID":"3","ItemCode":"4414082000005","ItemName":"Notebook 4414-082","Image":"http://aljeel.gct.om/ProductsImages/4414082000005_MT1.jpg","ItemPrice":0.500,"CreatedDate":"25/05/2018"}]},{"UserID":null,"UserName":null,"EmailID":null,"EmailIDExists":false,"Active":null,"Country":null,"WishListID":"24","WishListName":"Default","WishListItems":[]}],"Message":null}]';
var obj = JSON.parse(json)[0].Data;
obj.data = obj.WishListItems;
delete obj.WishListItems;
json = JSON.stringify([obj]);
console.log("FINAL JSON " + (json));
i want to change WatchListItem key with data key but when i run above code JSON key is not replacing any idea how can i solve this?