Inheritance in Object-oriented JavaScript
Inheritance in JavaScript is called prototypal inheritance. Objects inherit from objects. When we create an object from a class,
1 2 3 4 5 6 |
function MyClass() { // The class }; var myObject = new MyClass(); |
it always inherits from
1 |
MyClass.prototype |
In Java speak, this is like saying “any class inherits from Object class”.
1 2 3 |
public class MyClass extends Object { ... } |
If… Continue Reading
Recent Comments