Inheritance in JavaScript

In this lab, you are going to apply the concept of inheritance by creating classes and their relationship in JavaScript. First, you will create a Person class with properties 'firstName' and 'lastName'. Then, create a method 'fullName()' that returns the full name of the person.

After that, create another class Employee that inherits from the Person class. Add new properties 'position' and 'salary' to this derived class. Finally, create a 'toString()' method that returns the string representation of the Employee object.

Adding your container request
Getting your dedicated container
Connecting to your container
Setting up your editor
Finalizing your playground
TerminalEditorBrowser