title: How to update one Javascript object array without updating the other
body: <p>I created an object array with some values. Then I created another object array and initialized it with the first one. Then I pushed a value in 2nd array, and console logged both arrays. Both arrays had same value. Why is this happening and how can we stop this?</p>
  
  <p>My Code:</p>
  
  <pre><code>var a = { "filters": [] }; // 1st object array
  var keyValue = {};
  // pushed 2 values in "a" array
  keyValue["abc"] = "123";
  a.filters.push(keyValue);
  keyValue["def"] = "456";
  a.filters.push(keyValue);
  var b = a; // created another object array &amp; initialized it with "a" array
  var keyValue1 = {};
  // pushed 1 value in "b" array
  keyValue1["ghi"] = "789";
  b.filters.push(keyValue1);
  console.log(a);
  console.log(b);
  </code></pre>
  
  <p>This prints same values for a and b.<br>
  How do I push values into 2nd array without updating 1st one?</p>