title: Error "Cannot call toString on undefined" but variable is defined
body: <p>In this piece of Javascript</p>
  
  <pre><code>creds = cp[0];
  data[creds.toString()] = cp[1]; // data is an object
  </code></pre>
  
  <p>Chrome gives me the error <code>TypeError: Cannot call method toString of undefined</code> on the second line. However, I've verified via the debugger that the value of <code>creds</code> is at that point the number <code>1400</code>.</p>
  
  <p>What's going on?</p>