title: Pushing x and y values into array variables
body: <p>I have an array with variables. I would like to push some x and y coordinates into the array, but when i try to push instead of changing the variable values the push creates new variables and assign the value to those. </p>
  
  <p>So it looks like this</p>
  
  <pre><code>0: {id: "t523470", name: "tPm1", x: 0, y: 0, parent: null, …}
  1: {id: "t523471", name: "tPm2", x: 0, y: 0, parent: null, …}
  2: {y: 651, x: 446}
  3: {y: 800.015625, x: 802.328125}
  </code></pre>
  
  <p>Instead of this</p>
  
  <pre><code>0: {id: "t523470", name: "tPm1", x: 446, y: 651, parent: null, …}
  1: {id: "t523471", name: "tPm2", x: 802.328125, y: 800.015625, parent: null, …}
  
  
  
  
      function getModulePosition(id) {
  
          for (let i = 0; i &lt; axisViewElements.modules.length; i++) {
  
  
  
              let currentElement = axisViewElements.modules[i].id;
              if (id === currentElement) {
                  continue;
              }
              let module = document.getElementById(currentElement);
  
              let modulePos = { x: module.getBoundingClientRect().left, y: module.getBoundingClientRect().top }
              console.log(modulePos);
  
  
  
              axisViewElements.modules.push({
  
                  y: modulePos.y,
                  x: modulePos.x
  
              });
  
  
          }
      }
  </code></pre>