JSFiddle - React, Tailwind, and code Playground

by Andra Jimenez

JavaScript

/* Create an Employee and a Student class. Run greetAtGBC() against each of the classes. Your classes should have a constructor that takes a name */



function Employee(name){this.name=name;}

Employee.prototype.getEmployeeHomeTown = function(){
    return "Vancouver, BC";};

      var employee1 = new Employee("Andrea");
      var employee2 = new Employee("Holly");



function Student(name){
  this.name=name; 
}
      var student1 = new Student("Luke");
      var student2 = new Student("Pat");



/*function greetAtGBC(person) {
    console.log("Hello " + person.name + "!");
    if (person instanceof Employee) {
        console.log("Your mailroom is at A4-123");
    } else if (person instanceof Student) {
        console.log("How are your studies progressing?");
    }
}*/

greetAtGBC(student1);
    
    //alert(me.getEmployeeHomeTown());