1 function Hotel(name, rooms, booked) {
2 this.name = name;
3 this.rooms = rooms;
4 this.booked = booked;
5}
6
7 var quayHotel = new Hotel('Quay', 40, 29);
8 var parkHotel = new Hotel('Park', 28, 11);
1function Car(make, model, year) {
2 this.make = make;
3 this.model = model;
4 this.year = year;
5}
6
7var car1 = new Car('Eagle', 'Talon TSi', 1993);
8
9console.log(car1.make);
10// expected output: "Eagle"
1function Person(first, last, age, eye) {
2 this.firstName = first;
3 this.lastName = last;
4 this.age = age;
5 this.eyeColor = eye;
6}
1function Tree(name) {
2 this.name = name
3}
4
5let theTree = new Tree('Redwood')
6console.log('theTree.constructor is ' + theTree.constructor)
7