Skip to content

2017-Overdeadline-ostrich2821 js-homework #28

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

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

Conversation

TzuruC
Copy link

@TzuruC TzuruC commented Jul 19, 2017

No description provided.


var BMI = getBMI(1.5, 50);

function getMessage(){
Copy link

Choose a reason for hiding this comment

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

因為作業的題目是getMessage函式可以傳入height與weight,所以這邊建議把bmi放到函式內,並讓getMessage傳入height與weight兩個參數,然後在getMessage內呼叫getBMI,例如:

function getMessage(height,weight){
    var BMI=getBMI(height,weight);
        ......
}

}else if(18.5 <= BMI && 24 > BMI){
console.log('正常範圍');
}else{
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 "要顯示的訊息"就可以了

}
}

getMessage();
Copy link

Choose a reason for hiding this comment

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

這邊再console.log(getMessage(1.5,50));印出結果就好

@@ -0,0 +1,21 @@
function getBMI(height,weight){
Copy link

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