In C#, inheritance is as easy as:
class Animal {
string name;
public Animal() { }
}
class Dog : Animal {
public Dog() : base() {
this.name = "Dog";
}
}
In node.js, I want to have two files (animal.js and dog.js) replicate the above setup while being as simple and non-hacky as possible.
Is this even possible with node.js? If it matters, I'd like to do all this so that I can pass the Animal type through a function without checking the subclass as there will be dozens of classes inheriting the Animal class.