Excuse me for this simple problem - but I seem to miss something obvious.Any pointer would be a great help.
I have a JSON like
var whatever = [{
"key1" : { "text" : "text1","group" : "1" },
"key2" : { "text" : "text2","group" : "2" },
"key3" : { "text" : "text3","group" : "3" }
}];
I am trying to add another object(at start preferably) - but just couldn't get it to work.
var str = '{"text":"text0","group":"0"}';
var obj = JSON.parse(str);
whatever[0].put("key0",obj);
Getting the below error:
Uncaught TypeError: whatever[0].put is not a function