javascript: adding function to function inside .prototype = {
<p>If I add a function in the "constructor", I can extend it with an other function like so:</p>

<pre><code>var MyClass = function() {
    this.time = function() { return 4.5; }
    this.time.formatted = function() { return format(this.time(), "HH:mm"); }
}
</code></pre>

<p>I can't figure out a nice way to do this if I create the function in prototype like so:</p>

<pre><code>var MyClass = function() {}
MyClass.prototype = {
    time: function() { return 4.5; },
    time.formatted: function () { ... } // This does not work!
}


MyClass.prototype.time.formatted = function() { ... }
// the line above works but I don't like it since it separates everything.
// e.g. if I have 15 functions inside prototype, the .formatted will be like
// 50 lines apart from the time: function
</code></pre>

<p>*Edit: * On second thoughts the line above does not work, adding the .formatted messes
the reference to this. Perhaps solvable?</p>

<p>Any tips? Thanks!</p>
