Have a look at code below:
function person() {
this.fname = 'baby';
this.lname = 'boy';
this.walk = function () {
return 'i can walk';
}
}
person.prototype.walk=function(){ return 'all can walk';}
var obj=new person();
obj.walk();
Now i want to let both these funtions in my code but want that when i make the call to walk using obj.walk()...it should be calling walk function from prototype,as result return me 'all can walk'