JSFiddle - React, Tailwind, and code Playground

JavaScript

function Person (age, weight) {
		this.age = age;
		this.weight = weight;
	}

	Person.prototype.name = name;
	
	//we will give Person the ability to share their information.
	Person.prototype.getInfo = function () {
		return "I am " + this.age + " year old and weight " + this.weight + " kg.";
	};


	function Employee (age, weight, salary, name) {

		//Person.call(this, age, weight);  // by call parameters as arguments
		Person.apply(this, arguments);  // by apply arguments as array
		this.salary = salary;
	}

	Employee.prototype = new Person();
	Employee.prototype.constructor = Employee;

	Employee.prototype.getInfo = function () {
		return "I am "+this.name+" " + this.age + " year old and weight " + this.weight + " kg having $" + this.salary +" pm salary";
	}


	var person = new Employee(30, 70, 4000, "Manish");
	console.log(person.getInfo());

	document.write(person.getInfo());