سلام و خسته نباشید :
function Person(name , age , heigh , weight){
this.name = name;
this.age = age;
this.heigh = heigh;
this.weight = weight;
this.sayName = function(){
return this.name[0].toUpperCase() + this.name.slice(1);
}
this.sayHeight = function(){
this.heigh = this.heigh / 100;
return this.heigh + "m";
}
this.sayBmi = function(){
let bm = parseInt(this.weight / (Math.pow(this.weight , 2)));
return bm;
}
}
let milad = new Person("milad" , 31 , 185 , 89);
console.log(sayName());
console.log(this.age);
console.log(sayHeight());
console.log(sayBmi());