title: Overriding assignment operator in JS
body: <pre><code>var myObject = {"myKey" : "myValue"}
  typeof(myObject.myKey) returns `string`
  
  myObject.myKey = "newValue"
  console.log(myObject.myKey) prints newValue
  </code></pre>
  
  <p>This is the expected behavior. But, similar value writes do not work for document.cookie</p>
  
  <pre><code>typeof(document.cookie) returns `string`
  </code></pre>
  
  <p>But performing <code>document.cookie = "value=123"</code>, appends to <code>document.cookie</code> string rather than set its value to <code>value=123</code></p>
  
  <p>So, how is assignment to <code>document.cookie</code> overridden?</p>