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

Thursday, December 6, 2012

Codecademy: Codeyear Painting the Town Red


//sample solution


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

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

myBike.ride();

myBike.paintRed();
//test
console.log(myBike.color);

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts