Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bmi work #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

bmi work #17

wants to merge 1 commit into from

Conversation

losevoid
Copy link

No description provided.

<script>
var weight = 55;
var heigh =1.68;
var msg,bmi;
Copy link

Choose a reason for hiding this comment

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

msg變數沒有使用到?

function getMes(w, h){
bmi=w/(h*h);
if(bmi>35)
console.log("重肚肥胖");
Copy link

Choose a reason for hiding this comment

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

這樣是直接輸出,沒有做回傳的動作
題目是要讓函數回傳,所以先return訊息

ps.重「肚」肥胖🤣

console.log("過瘦");

}
getMes(weight,heigh);
Copy link

Choose a reason for hiding this comment

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

這邊再將函式回傳的結果log出來

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.

3 participants