Skip to content

Commit 82cfcc6

Browse files
Updated BMI calculation to use exponentiation operator
1 parent d18dbb8 commit 82cfcc6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
function calculateBMI(weight, height) {
88
// return the BMI of someone based off their weight and height
9-
const bmi = weight / (height * height);
9+
const bmi = weight / (height ** 2);
1010
return bmi.toFixed(1);
1111
}
12-
console.log(calculateBMI(70, 1.73));
12+
console.log(calculateBMI(70, 1.73));

0 commit comments

Comments
 (0)