Created
September 29, 2017 18:18
-
-
Save ganesharulanantham/dacf66c681fad4be5d3223e8588f3d9e to your computer and use it in GitHub Desktop.
Learn and experiment prototype design
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
/** | |
* Created by ganesharulanantham on 28/09/17. | |
*/ | |
var TeslaModelS = function() { | |
this.numWheels = 4; | |
this.manufacturer = 'Tesla'; | |
this.make = 'Model S'; | |
} | |
TeslaModelS.prototype.go = function() { | |
} | |
TeslaModelS.prototype.stop = function() { | |
console.log('Apply brake pads'); | |
} | |
var tesla = new TeslaModelS() | |
console.log(tesla.numWheels) | |
console.log(tesla.go()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment