-
Notifications
You must be signed in to change notification settings - Fork 29
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
base: master
Are you sure you want to change the base?
bmi work #17
Conversation
<script> | ||
var weight = 55; | ||
var heigh =1.68; | ||
var msg,bmi; |
There was a problem hiding this comment.
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("重肚肥胖"); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這邊再將函式回傳的結果log出來
No description provided.