title: Increment Object set javascript
body: <p>I have an object set</p>
  <pre><code>var obj = {
   ref01:{
   test:&quot;abc&quot;
  },
  ref02:{
   test:&quot;xyz&quot;
  },
  ref03:{
   test:&quot;pqr&quot;
  }
  }
  </code></pre>
  <p>and I have new object</p>
  <pre><code>const test = {
    test:&quot;def&quot;
  }
  </code></pre>
  <p>I want to update the object above with increment value of <strong>ref</strong>
  Now ref is03 , I want to append like  ref04 and increment each time based on existing obj.</p>
  <pre><code>var obj = {
   ref01:{
   test:&quot;abc&quot;
  },
  ref02:{
   test:&quot;xyz&quot;
  },
  ref03:{
   test:&quot;pqr&quot;
  },
  ref04:{
   test:&quot;def&quot;
  }
  }
  </code></pre>
  <p>i tried object.assign but its directly passing the value .
  <code>obj = object.assign(obj,{ref:test})</code></p>
  <p>So how can i get it ?</p>