View on GitHub

reading-notes

Duckett HTML Ch. 6 Tables (p.126-145)

What’s A Table?

Basic Table Structure

Table Headings

Duckett JS Ch.3 Functions, Methods and Objects (p.106-144)

Creating an Object: Constructor Notation

var hotel = new Object();

hotel.name = 'Quay';
hotel.rooms = 40;
hotel.booked = 25;

hotel.checkAvailability = function (){
  return this.rooms -this.booked;
};

Creating Many Objects: Constructor Notation

function Hotel(name, rooms, booked){
  this.name = name;
  this.rooms = rooms;
  this.booked = booked;
  this.checkAvailability = function(){
    return this.rooms - this.booked;
  };
}
var quayHotel = new Hotel('Quay',40,25);
var parkHotel = new Hotel('Park',120,77);

Back to Homepage