Skip to content

Commit 578600f

Browse files
committed
Fix indentation and return type in calculateBMI function
1 parent b24523e commit 578600f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Sprint-2/3-mandatory-implement/1-bmi.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@
1414
// Then when we call this function with the weight and height
1515
// It should return their Body Mass Index to 1 decimal place
1616

17-
function calculateBMI(weight, height) {const bmi = weight / (height * height);
18-
return bmi.toFixed(1);
17+
function calculateBMI(weight, height) {
18+
const bmi = weight / (height * height);
19+
return Number(bmi.toFixed(1));
1920
}
21+
2022
console.log(calculateBMI(70, 1.73));
2123

24+
2225
// return the BMI of someone based off their weight and height

0 commit comments

Comments
 (0)