# Method inheritance with \_\_proto\_\_

**URL:** <https://forum.kirupa.com/t/method-inheritance-with---proto--/95543>\
**Category:** Uncategorized\
**Created:** [November 26, 2003, 9:33pm UTC](https://forum.kirupa.com/t/method-inheritance-with---proto--/95543 "2003-11-26T21:33:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mojoNYC](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@mojoNYC](https://forum.kirupa.com/u/mojoNYC)\
**Post date:** [November 26, 2003, 9:33pm UTC](https://forum.kirupa.com/t/method-inheritance-with---proto--/95543/1 "2003-11-26T21:33:21Z")

</div>

i’m trying to add the prototype methods of twoClass to the protype methods of oneClass like this:

```auto

Function.prototype.extend=function(superclass){
	this.prototype. __proto__ =superclass.prototype; };

twoClass.myFunc=function() //pseudo ext

twoClass.extend (oneClass);
//twoClass and oneClass are class constuctors

```

i think i should be able to call a prototype method in twoClass the same way it’s called in oneClass:

```auto

myObj=new (oneClass) //pseudo ex

myObj.myFunc(); //calls function inherited from twoClass

```

unfortunately, it’s not working for me right now–can anybody show me the method for adding one classes’ prototype functions to anothers? mucho obligato…

-mojo
