title: inserting javascript variable value in json
body: <p>i have a JSON variable which looks like this :</p>
  
  <pre><code>{"events": [
  {"event_id": "1", "event_name": "Breakfast"},
  {"event_id": "1", "event_name": "Calling Bob"}
  ]};
  </code></pre>
  
  <p>i have two vaiables</p>
  
  <pre><code>x=2; y=jam;
  </code></pre>
  
  <p>i want to push the variables in json such that x is event_id and y is event_name, so that my json will look like-</p>
  
  <pre><code>{"events": [
  {"event_id": "1", "event_name": "Breakfast"},
  {"event_id": "1", "event_name": "Calling Bob"},
  {"event_id": "2", "event_name": "jam"}
  ]};
  </code></pre>
  
  <p>the function iam using to push is</p>
  
  <pre><code>k='({"event_id":"'+x+'","event_name":"'+y+'"})';
  san.events.push(k);
  </code></pre>
  
  <p>where san is the variable in which i stored the json.
  iam parsing the variable san and applying the push action and stringifying it and displaying it, but in the result my json data syntax is changing like additional '/' symbols are generating in the json.</p>