JavaScript prototype problem
<p>If I call <code>myRobot.Speak.sayHi()</code> it always returns <code>undefined</code>. Please, what am I doing wrong? Thanks for reply!</p>

<pre><code>var Factory = (function() {

    // Constructor  
    var Robot = function() {

    };

    // Public
    return {
        extendRobot: function(power, methods) {
            Robot.prototype[power] = methods;
        },
        createRobot: function() {
            return new Robot();
        }
    };

}());

Factory.extendRobot('Speak', {
    sayHi: function() {
        return 'Hi, ' + this.name;
    }
});

var myRobot = Factory.createRobot();
myRobot.name = 'Robin';
myRobot.Speak.sayHi() // =&gt; ‘Hi, Robin’
</code></pre>
