Open
Conversation
Evafly
reviewed
Aug 4, 2017
| return BMI; | ||
| } | ||
|
|
||
| getBMI(59,180); |
There was a problem hiding this comment.
可以不用這一行歐,這一行只有在網頁檢查時看得到結果,真正要在瀏覽器中顯示結果需要console.log噢
| console.log("BMI: "+getBMI(59,180)); | ||
|
|
||
| function getMESSAGE(W,H) { | ||
| var bmi = W/((H/100)*(H/100)); |
There was a problem hiding this comment.
可以直接取getBMI()計算出來的值就好歐
var bmi=getBMI(w,h);
| console.log("中度肥胖") | ||
| } | ||
| else if (35 <= bmi ){ | ||
| console.log("重度肥胖") |
There was a problem hiding this comment.
每一個判斷都可以直接return "要顯示的訊息"就好,不需要console.log()
| console.log("重度肥胖") | ||
| } | ||
| } | ||
| getMESSAGE(59,180); No newline at end of file |
Evafly
reviewed
Aug 4, 2017
| @@ -0,0 +1,30 @@ | |||
| function getBMI(W,H) { | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.