Hi Everyone,
I am wondering how to simulate Class Inheritance in JavaScript. I know class doesn't apply to JavaScript, the way we use is Functions to create objects and do the inheritance things through Prototype object.
For example, how do you convert this structure into JavaScript :
public class Mankind {
public string name;
public string lastname;
}
public class Person: Mankind {
public void Run(string fromWhat) {
//write the run logic
}
}
What is the equivalent of this piece of code in JavaScript.
Edit:
I've also found another link where Douglas Crockford explains different inheritance models as CMS does
http://javascript.crockford.com/inheritance.html
Hope it helps others as well.