Skip to content

BMI#30

Open
mkdev-tw wants to merge 1 commit into
hellojs-tw:masterfrom
mkdev-tw:master
Open

BMI#30
mkdev-tw wants to merge 1 commit into
hellojs-tw:masterfrom
mkdev-tw:master

Conversation

@mkdev-tw

Copy link
Copy Markdown

No description provided.

Comment thread BMI.js
return BMI;
}

getBMI(59,180);

@Evafly Evafly Aug 4, 2017

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以不用這一行歐,這一行只有在網頁檢查時看得到結果,真正要在瀏覽器中顯示結果需要console.log噢

Comment thread BMI.js
console.log("BMI: "+getBMI(59,180));

function getMESSAGE(W,H) {
var bmi = W/((H/100)*(H/100));

@Evafly Evafly Aug 4, 2017

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以直接取getBMI()計算出來的值就好歐
var bmi=getBMI(w,h);

Comment thread BMI.js
console.log("中度肥胖")
}
else if (35 <= bmi ){
console.log("重度肥胖")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

每一個判斷都可以直接return "要顯示的訊息"就好,不需要console.log()

Comment thread BMI.js
console.log("重度肥胖")
}
}
getMESSAGE(59,180); No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這邊再console.log(getMESSAGE(59,180));就好囉

Comment thread BMI.js
@@ -0,0 +1,30 @@
function getBMI(W,H) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

記得//你的大名

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants