// Declare the Car prototype function Car (type) { this.type = type; this.color = "red"; this.drive = function() { return "Vrroommm !!!!!" }; } // Create a Car instance var car = new Car('Ferrari'); car.color = "red"; car.engine = "V8"; alert(car.engine); // where did that come from ! car.drive = function() { return "Wrrrrrrrr !!!!!" } alert(car.drive()); // that's not a sound a Ferrari makes
Tags: JavaScript, Elevate Web Builder | Permanent Link • 8 Comments |
This web page was last updated on Friday, May 3, 2024 at 10:28 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |