Category: Code

Inheritence in JavaScript

In the code above we got duplicate properties of name and age for both person and student. To make this more effieicent we can use inheritence if we know that student1 is person1 and have the same name and age.. Check of which type an object is by adding With the instanceof operator we can …