Skip to content

week2-HW #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

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

week2-HW #29

wants to merge 1 commit into from

Conversation

ShuTLIN
Copy link

@ShuTLIN ShuTLIN commented Jul 20, 2017

No description provided.

function getMessage(height,weight){
var result=weight/(height*height);
if (result>24) {
var answer='BMI過高 體重正常範圍為 BMI=18.5~24 ';
Copy link

Choose a reason for hiding this comment

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

小小建議:直接return"要顯示的訊息"就可以囉

};

function getMessage(height,weight){
var result=weight/(height*height);
Copy link

Choose a reason for hiding this comment

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

這裡可以直接用result=getBMI(height,weight);就好囉,可以不用再多計算一次

@@ -0,0 +1,23 @@
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