Skip to content

Commit 7fffa46

Browse files
committed
Remove error validation in calculateBMI function
1 parent 9c59b1a commit 7fffa46

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
// It should return a string of their Body Mass Index to 1 decimal place
1616

1717
function calculateBMI(weight, height) {
18-
if (!height || height <= 0){ // to catch cases of undefined and null
19-
throw new Error('Height must be greater than 0');
20-
}
18+
2119
const heightSquared = height ** 2;
2220
return weight / heightSquared;
2321
}

0 commit comments

Comments
 (0)