Boolean values fail tests in arithmetic expressions despite valid results

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:

  1. Open the arithmetic debugging lab.

  2. Define a result variable using an expression that includes a boolean value (e.g., true + 2 + 3).

  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);

Welcome back to the forum @marcusnapoleon

Please post a link to the challenge.

Happy coding

Hello,

Hi @marcusnapoleon

The declarations were changed from const to let.

You are not asked to change the way the variables are declared.

Make sure to remove null from the last bit of code.

Happy coding