Skip to content

Instantly share code, notes, and snippets.

@bradpauly
Created March 7, 2013 21:08
Show Gist options
  • Save bradpauly/5111810 to your computer and use it in GitHub Desktop.
Save bradpauly/5111810 to your computer and use it in GitHub Desktop.
bmw = { color: 'blue', make: 'BMW' };
vw = { color: 'green', make: 'VW' };
function logCar(car){
console.log("I'm a " + car.color + " " + car.make + "!");
}
logCar(bmw);
function Car(info){
this.color = info.color;
this.make = info.make;
this.log = function(){
console.log("I'm a " + this.color + " " + this.make + "!");
}
}
c = new Car(vw);
c.log();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment