This is probably a simple solution, but I can't get it to work: / I want to create a new “answer” from the results compiled by calling json / api.
jsonResponse = [
{"_id":"1","desc":"test desc","title":"Title 1"},
{"_id":"2","title":"Title 2","desc":"desc 2"}
];
I need to create a new array from this that looks like this:
var newResponse = [
{ "heading" : "Title 1", "summary" : "test desc"},
{ "heading" : "Title 2", "summary" : "desc 2"}
];
Removing _id and changing the "key". How can i do this?
source
share