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

Wednesday, December 5, 2012

Codecademy: Codeyear Get at it


//sample solution


// make a Card constructor here.  It should take two parameters
// representing the suit and number of the card to be created
function Card(suit, number){
this.suit = suit;
this.number = number;
//methods
this.getSuit = function(){
return this.suit;
};
this.getNumber = function(){
return this.number;
};
}
//test
var card = new Card(4,8);
console.log(card.getSuit());
console.log(card.getNumber());

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts