元ネタ
わーい、すごーい
に触発されて
function フレンズ() {
this.message = '';
}
フレンズ.prototype = {
わーい: function() {
this.message += 'わーい\n';
return this;
},
すごーい: function() {
this.message += 'すごーい\n';
return this;
},
たのしー: function() {
this.message += 'たのしー\n';
return this;
},
フレンズ: function(skill) {
this.message += '君は' + skill + 'がとくいな、フレンズなんだね!!\n';
return this;
},
toString: function() {
var message = this.message;
this.message = '';
return message;
},
};
alert(new フレンズ()
.わーい()
.すごーい()
.たのしー()
.フレンズ('クソリプ'));