Created
December 26, 2015 17:43
-
-
Save zoolu-got-rhythm/5eda347f3c788344053a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Car(make, creed){ | |
this.wheels = 4; | |
this.colour = "red"; | |
this.make = make; | |
this.model = creed; | |
} | |
Car.prototype.getSummary = function(){ | |
return "this car has " + this.wheels + " wheels, is " + | |
this.colour + ", manufactored by " + this.make + " and is a " + this.model; | |
}; | |
var instance1 = new Car(); | |
// set properties | |
instance1["make"] = "ford"; | |
instance1.model = "mustang"; | |
// check properties | |
console.log(instance1.getSummary()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment