title: Cannot Set Property ... of undefined --- bizarre
body: <p>I'm getting a bizarre error in Chrome...  check out the screenshot below.</p>
  
  <p>I define record using object literal syntax.  </p>
  
  <p>I try setting the "id" property and get the exception.</p>
  
  <p>I've tried both :</p>
  
  <pre><code>record['id'] = 'wtf';
  </code></pre>
  
  <p>and also</p>
  
  <pre><code>record.id = 'wtf';
  </code></pre>
  
  <p>I use this type of syntax all over the place in my script.... what could be going on here ?
  Is this a bug in Chrome ?</p>
  
  <p><img src="https://i.stack.imgur.com/E13Sm.jpg" alt="alt text"></p>
  
  <p>EDIT :
  I've solved the problem for now, but I'm still not sure why this is happening.
  I moved the definition of record to occur outside of the if block.  Anyone know what could be occurring ?  I thought all variable declarations were scoped to the function and therefore this shouldn't be an issue.</p>