title: My JavaScript object has a length field which I didn't assign
body: <p>I have a rather strange problem which I haven't been able to find a solution to. It might be because no one has had this issue, or it could be the fact that I'm rather lost on what to Google.</p>
  
  <p>Here's what's going on. I'm building a Rock-Paper-Scissors machine learning demo, and I have two JavaScript objects which are important to the script. Those two objects are the <code>winners</code> (an object which stores what beats what), and <code>history</code> (keeps track of all the plays). </p>
  
  <p>At the very top of my script, I make both of those objects, as such:</p>
  
  <pre><code>var winners = {
  
  }
  
  var history = {
  
  }
  </code></pre>
  
  <p>Now I'm getting to the problem. I have the rest of the code done, but it is irrelevant, because when I comment it out, and since I'm using p5.js, I have a preload function where I simply print out both objects.</p>
  
  <pre><code>function preload(){
      console.log(winners);
      console.log(history);
  }
  </code></pre>
  
  <p>Then I go into Chrome and run the html which uses the script, open the console. I should see:</p>
  
  <pre><code>Object {}
  Object {}
  </code></pre>
  
  <p>But NOPE!</p>
  
  <pre><code>Object {}
  History {length: 1, scrollRestoration: "auto", state: null}
  </code></pre>
  
  <p>The winners object is just an empty object, but my history object has a length attribute as well as some other stuff. All of my other code is commented out, I promise.</p>
  
  <p>Why does my history object have the stuff in it and how can I get rid of it?</p>
  
  <p><a href="https://i.stack.imgur.com/J1mI9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/J1mI9.png" alt="enter image description here"></a></p>