<HTML> <HEAD><TITLE>"Fun" with Objects</TITLE> <SCRIPT LANGUAGE = "JavaScript"> // The Car Object Constructor function Car(color, brand, horsepower, price) { this.color = color; this.brand = brand; this.horsepower = horsepower; this.price = price; this.showBrand = showBrand; } // The showBrand() Method of the Car Object function showBrand() { document.write(this.brand); } </SCRIPT> </HEAD> <BODY BGCOLOR = "#FFFFFF"> A Car Object: <P> <SCRIPT LANGUAGE = "JavaScript"> mycar = new Car("Red", "Ford", 160, 15000); // create new car object mycar.showBrand(); // run its showBrand method </SCRIPT> </BODY> </HTML>