プロトタイプチェーンを繋ぐのにわざわざ、関数定義してprototypeに代入するのめんどくさい!!
ってことで一行で書いて少しは楽に・・・・
ならないよね^^;;;;;
//Executable with HDJSExecuter
(window.Human=function(){this.init.apply(this,arguments)}).prototype= {
init: function(name) {
this.name=name;
},
sayMyName: function() {
alert('My name is ' + this.name + '.');
}
};
var amachang = new Human('あまの');
amachang.sayMyName();
*1:ちょうくーるなぷろとたいぷべーすのぷろぐらみんぐげんご