Javascript object methods
<p>Why I cannot do this? </p>

<pre><code>var MyObject = {}
MyObject.foo = function(){
  this.sayhello = function(){
    alert('Hello');
  }
}
MyObject.foo.sayhello();
</code></pre>

<p>Any ideas on how it could be done?</p>
