title: problem with array of object javascript ad property
body: <p>I have this function that accepts an array of objects as input and transforms it into an array of strings, but when I do the console log the property are wrong, I can't understand why.
  as you can see the two console logs are of the same object, in the first the <code>x.credititoTotale</code> property has a value in the second console.log where I go to access it directly with <code>x.credititoTotale</code> has another value</p>
  <pre><code>const stringArray = [];
  export const convertToStringForDb = (objectArray) =&gt; {
    objectArray.forEach((x) =&gt; {
      console.log(x);
      console.log(x.credititoTotale + &quot; &quot; + x.id);
      stringArray.push(
        `${x.id}/${x.cognome}/${x.nome}/${x.totaleCG}/${x.time}/${x.credititoTotale}`
      );
    });
  
    return stringArray;
  };
  </code></pre>
  <p>look the screen ---&gt; <a href="https://i.stack.imgur.com/jcbYm.png" rel="nofollow noreferrer">screen of console.log </a></p>
  <p>when I print x the value of 'credititoTotale' is '-20'
  when I print x.credititoTotale the value is '-10'</p>
  <p>it should always be the same because it is the same object printed in the same for loop</p>