I have a web service that accept JSON in a specific format. However, I'm given a JSON of values but with different key names.
I know it's inefficient at the moment since it's just simply projecting data from one to another.
All I need to do is convert this:
var json1 = { key1: "Value1", key2: "Value2", key3: "Value3" };
to
var json2 = { state: "Value1", city: "Value2, zipcode: "Value3" };
I looked into $.map
but I'm not really sure how to use it in this case.