How to apply virtual function in javascript
<p>In C#, we have concept about abstract method, and how to apply this in Javascript. Example, I have an example:</p>

<pre><code>function BaseClass() {
    this.hello = function() {
        this.talk();
    }
    this.talk = function() {
        alert("I'm BaseClass");
    }
};

function MyClass() {
    this.talk = function() {
        alert("I'm MyClass");
    }
    BaseClass.call(this);
};

MyClass.prototype = new BaseClass();

var a = new MyClass();
a.hello();​
</code></pre>

<p>How the function hello() in BaseClass call the function do() from MyClass when the object is an instance of MyClass. The alert result must be "I'm MyClass". Please help me. Thanks.</p>
