title: How does the window.onload function work?
body: <p>I don't know javascript well. So may be stupid question here:</p>
  
  <p>Suppose, we can add a prototype or say property to the window object like </p>
  
  <pre><code>window.something = function(){..}
  </code></pre>
  
  <p>or, </p>
  
  <pre><code>window.something = "somestring"
  </code></pre>
  
  <p>But how <code>window.onload = function(){....}</code> is not creating onload function but assigning it to run when loaded....</p>
  
  <p>And if the onload is built-in function then <code>window.onload = function(){...}</code> should override the onload function....?!?!</p>