回答編集履歴
1
追記
answer
CHANGED
@@ -1,2 +1,24 @@
|
|
1
1
|
BMI関数の呼び方が間違っていませんか?
|
2
|
-
BMI(height,weight)になりそうな気がします。
|
2
|
+
BMI(height,weight)になりそうな気がします。
|
3
|
+
|
4
|
+
【追記】
|
5
|
+
検証してみました
|
6
|
+
|
7
|
+
```javascript
|
8
|
+
var height = 1.7;
|
9
|
+
console.log('height: ' + height);
|
10
|
+
var weight = 60;
|
11
|
+
console.log('weight: ' + weight);
|
12
|
+
|
13
|
+
// この下にコードを書いてください
|
14
|
+
function BMI(height,weight){
|
15
|
+
return weight/height/height;
|
16
|
+
}
|
17
|
+
console.log(Math.round(BMI(height,weight)));
|
18
|
+
|
19
|
+
function ProperWeight(height){
|
20
|
+
return height*height*22;
|
21
|
+
}
|
22
|
+
console.log(Math.round(ProperWeight(height)));
|
23
|
+
```
|
24
|
+
これで表示されました。(日本語部分は割愛しています)
|