javascript でのコンストラクタの使い方
var Human = function(name, weight, height){
this.name = name;
this.weight = weight;
this.height = height;
this.getBmi = function(){
this.bmi = this.weight / (this.height * this.height);
return this.bmi;
}
}
var human = new Human("tanaka", 65, 1.7);
console.log(human.name + "さんのBMIは" + Math.round(human.getBmi()) + "です。");