title: How to push data coming from setInterval into an array
body: <p>My setInterval function should inject data into an array. It is object -- <code>{id: 0}</code> and then <code>{id:1}{id:2}</code>...--to be injected and the value of id changes after every timeout has fired. But instead of populating it into an array in order to get something like <code>[{id:1}, {id:2}, {id:3}...]</code> I'm getting still the same value <code>[{id:1}]</code>. I'm using push function:</p>
  
  <pre><code>const arr = [];
  arr.push(this.props.test);
  console.log(arr);
  </code></pre>
  
  <p><code>this.props.test</code> is just new object after setInterval fires every time. Contrary to my expectations I'm getting always last object in my console.log. </p>