I am trying to push
data.push({\"country\": \"IN\"});
as new id and value to a json string. but it gives the following error
Your data variable contains an object, not an array, and objects do not have the push function as the error states. To do what you need you can do this:
data
push
data.country = 'IN';
Or
data['country'] = 'IN';