Quotes help make search much faster. Example: "Practice Makes Perfect"

Thursday, December 6, 2012

Codecademy: Codeyear Connecting the Dots


//sample solution


function Bike( color, numGears ) {
    this.color = color;
    this.numGears = numGears;
    this.numWheels = 2;
   
    this.ride = function() {
        console.log("I'm riding!");
    }
    this.paintRed = function() {
        this.color = "red";
    }
   
}

var myBike = new Bike("Blue", 6);

myBike.paintRed();

console.log("myBike has " + myBike.numGears + " gears and is now " + myBike.color + ".");

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts