There was an error while loading. Please reload this page.
1 parent 46ff75c commit bc36994Copy full SHA for bc36994
1 file changed
Sprint-3/3-mandatory-implement/1-bmi.js
@@ -15,5 +15,15 @@
15
// It should return a string of their Body Mass Index to 1 decimal place
16
17
function calculateBMI(weight, height) {
18
- // return the BMI of someone based off their weight and height
+ return Number.parseFloat(weight / (height * height)).toFixed(1);
19
}
20
+
21
+// Tests
22
+console.log(calculateBMI(55, 1.63));
23
+console.log(calculateBMI(120, 1.73));
24
+console.log(calculateBMI(80, 1.69));
25
+console.log(calculateBMI(51, 1.55));
26
27
+// Please could I have a little feedback about if I have refactored the function return too much?
28
+// And if so, what is a good guide on how many operations to perform in one line..? I can also
29
+// ask this in class if you prefer.
0 commit comments