什么是技术方法,以及SYNTAX实现原型继承

问题描述:

技术的方法是什么,以及SYNTAX实现原型继承的方法。我想要完整的继承方式。我们可以通过什么方式实现继承?我想这些是三种方式。解释和技巧?



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??

//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()
{
}

您可以参考以下链接..这是一个很好的解释提供



原型 [ ^ ]



即使你也可以参考这个



原型继承 [ ^ ]
You can refer below link..it's a nice explanation provided

prototypal[^]

even you can refer this also

prototypal inheritance[^]