Skip to content

Commit cc4743e

Browse files
committed
Refactor 3-mandatory-implement/1-bmi.js
1 parent 63fd040 commit cc4743e

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
function calculateBMI(weight, height) {
1818
// return the BMI of someone based off their weight and height
19-
const heightSquared = Number((height * height).toFixed(2));
20-
return (weight / heightSquared).toFixed(1);
19+
return (weight / (height * height)).toFixed(1);
2120
}
2221

2322
console.log(calculateBMI(70, 1.73));

0 commit comments

Comments
 (0)