OneCompiler

creating an object using constructor pattern

117

function Person(first,last,age,city){
this.firstName = first;
this.lastName= last;
this.age = age;
this.city = city
}

const mySelf = new Person("heath","ledger",30,"alabama")
console.log(mySelf)