Click here to Skip to main content
15,881,455 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
What are the ways techniques, and SYNTAX to acheive prototypal inheritance. I want complete ways of inheritance. what are the ways we can acheive inheritance?? i guess these are three ways\syntax and techniques??

JavaScript
//first way 
myFunc.prototype= another.prototype;

//second way 
myfunc= object.create(another.prototype);

//third way 
myfunc= new another();
///while the functions are
function another()
{
}
function myFunc()
{
}
Posted

1 solution

You can refer below link..it's a nice explanation provided

prototypal[^]

even you can refer this also

prototypal inheritance[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900