Reputation: 2405
I am trying to update data inside an object, here is the sample of object:
List myData = [
{"data": "hello 1", "data 2": "hello 2"}
];
is it possible to add "data 3":"hello 3"
inside myData[0]
without creating a new object? so here is the the object that I want:
List myData = [
{"data": "hello 1", "data 2": "hello 2","data 3":"hello 3"}
];
Upvotes: 0
Views: 129
Reputation: 3418
You can easily add data to the map:
myData[0]["data 3"] = "hello 3";
Upvotes: 2