JSFiddle - React, Tailwind, and code Playground

by lucasprus

JavaScript

function Employee() {
    this.firstName = 'Lucas';
    this.lastName = 'Prus';
    this.sayHello = function() {
        document.write(this.firstName + " " + this.lastName);
    };

}



var employee = new Employee();

Employee.prototype.age = 29;
Employee.prototype.sayAge = function() {
    document.write(this.age);
};

employee.sayHello();
employee.sayAge();