//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