How do I convert a JSON array into a JSON object. For example, I have created a variable which holds a JSON array:
[{ "Bank Account Name": "State Bank",
"Currency Code": "4000",
"Deposit Date": "5/2/1794",
"Payment Channel": "check"}]
How do I convert it into a JSON object with entities as a JSON object which look like this:
{"Entities ":[{ "Bank Account Name": "State Bank",
"Currency Code": "4000",
"Deposit Date": "5/2/1794",
"Payment Channel": "check"}]
}
Is there a way to do this? I tried Stringify and parse.
var newObj = {Entities: oldObj}getJSONObject(int index)