I am trying to push
data.push({\"country\": \"IN\"});
as new id and value to a json string. but it gives the following error
I think you set it as
var data = [];
but after some time you made it like:
data = 'some thing which is not an array';
then data.push('') will not work as it is not an array anymore.
data.push('')