In the JavaScript arithmetic debugging exercise, using boolean values (true or false) within expressions causes tests to fail, even when the final computed result is correct.
Steps to Reproduce:
-
Open the arithmetic debugging lab.
-
Define a result variable using an expression that includes a boolean value (e.g.,
true + 2 + 3). -
Run the tests.
Expected Result:
The tests should pass if the final evaluated numeric result is correct, regardless of intermediate value types.
Actual Result:
The tests fail when a boolean is included in the expression, even if the final output is correct.
Suggested Fix:
Clarify in the instructions that boolean values should not be used at all in expressions, or update the tests to validate only the final numeric result instead of enforcing strict type usage.
CODE :
let firstResult = 5 + 10;
console.log(firstResult);
let secondResult = 8 - 5;
console.log(secondResult);
let thirdResult = 3 + 3;
console.log(thirdResult);
let fourthResult = 0 + 8;
console.log(fourthResult);
let fifthResult = 10 * 2;
console.log(fifthResult);
let sixthResult = null + 22;
console.log(sixthResult);