تابستون داره تموم میشه ها، فرصت‌ها محدودن کلی آفر جذاب در کمپین تابستون🔥👇
۰ ثانیه
۰ دقیقه
۰ ساعت
۱ parisa sadat
پاسخ تمرین
جامعه جاوا اسکریپت ایجاد شده در ۱۲ تیر ۱۴۰۲
function Person(name, age, height, wight){
    this.name = name;
    this.age = age;
    this.height = height;
    this.wight = wight;
    this.personName = function(){
        let captalFirst = this.name;
        return "My name is" + ' ' + captalFirst.charAt(0).toUpperCase() + captalFirst.slice(1)
    };
    this.personBmi = function (){
        let ibmPer = this.wight / ((this.height / 100 ) **2).toFixed(2)
        return "My BMI is" + " " + ibmPer;
    }
}
let parisa = new Person('ali', '34', '160', '58');
console.log(parisa,);
console.log(parisa.personName());
console.log(parisa.personBmi());

بسیار عالی، موفق باشید?

بهترین پاسخ
محسن موحد ۱۲ تیر ۱۴۰۲، ۱۷:۲۰