JSFiddle - React, Tailwind, and code Playground

by veer712

JavaScript

var employee = function(){
  this.name = "Veer";
  this.age = "31";
  this.display = function(){
    alert(this.name + " is " + this.age + " years Old!!");
  }
}

var emp = new employee();
employee.prototype.address = function(){
  this.location = "Pune";
  alert(this.name + " lives in " + this.location + "!!");
}
emp.name = "Raul";
emp.age = "30";
emp.display();
emp.address();