Skip to content

Commit 33218f8

Browse files
committed
I return the result as a number
I was able to test my data type using typeof
1 parent cf13333 commit 33218f8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020
const bmi = weight / (height * height);
2121

2222
// Round to 1 decimal place and return
23-
return bmi.toFixed(1);
23+
return Number(bmi.toFixed(1));
2424
}
2525

2626
// Test cases
2727
console.log(calculateBMI(85, 1.54)); // 35.8
2828
console.log(calculateBMI(60, 1.65)); // 22.0
2929
console.log(calculateBMI(72, 1.80)); // 22.2
30-
// now the function is reusable and correct.
30+
// now the function is reusable and correct.
31+
console.log(typeof calculateBMI(85, 1.54));

0 commit comments

Comments
 (0)