Enums in Javascript

J/Javascript 2014. 3. 19. 15:51

function Suit(name){

this._name = name;

}

 

Suit.prototype.toString = function(){

return this._name;

}

Suit.CLUBS = new Suit('clubs');

Suit.DIAMONDS = new Suit('diamonds');

Suit.HEARTS = new Suit('hearts');

Suit.SPADES = new Suit('spades');

 

설정

트랙백

댓글