Skip to content

Instantly share code, notes, and snippets.

@ganesharulanantham
Created September 29, 2017 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ganesharulanantham/dacf66c681fad4be5d3223e8588f3d9e to your computer and use it in GitHub Desktop.
Save ganesharulanantham/dacf66c681fad4be5d3223e8588f3d9e to your computer and use it in GitHub Desktop.
Learn and experiment prototype design
/**
* 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