Skip to content

Instantly share code, notes, and snippets.

@bonza-labs
Created September 15, 2011 23:35
Show Gist options
  • Save bonza-labs/1220803 to your computer and use it in GitHub Desktop.
Save bonza-labs/1220803 to your computer and use it in GitHub Desktop.
OO javascript
var Car = function(make, color){
this.make = make;
this.color = color;
this.log = function(){
console.log('I am a '+ this.color +' '+ this.make);
};
}
// Example call for OO version:
(new Car('Ferrari', 'red')).log();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment