پاسخ تمرین جلسه

پرسیده شده
فعالیت 924 روز پیش
دیده شده 393 بار
1
function Person(name, age, height , weight){
                this.name = name.toLowerCase().replace(/\b[a-z]/g, function(letter) {
                  return letter.toUpperCase();
                });;
                this.age = age;
                this.height = height;
                this.weight = weight;
                this.bmi = function(){
                    return (this.weight/(this.height/100)**2);
                }
                this.SayName = function(){
                    return "MyNameIS:"+ this.name;
                }
            }


            var mohamad = new Person('Mohamad Nazari', 20 , 170 ,70);
            console.log(mohamad);
            console.log(mohamad.bmi());
فایل پیوست

0
حذف شده

سلام

خوبه فقط چه دلیلی داشته که اول کاراکترها را کوچیک کنید و بعد بزرگ؟ جهت اطمینان بوده درسته؟ 

فایل پیوست

مهرداد دادخواه

توسط

مهرداد دادخواه

2 آبان 00