Are All of the Tests Correct for Basic JavaScript: Understanding Undefined Value returned from a Function

One of the tests says that “sum” should equal 8.

However, when I’ve called console.log(sum) I’ve gotten 5, even though all of the tests pass. It makes sense that I’ve gotten 5, since sum only gets called by one use of addFive(). This suggests to me that the test is not correct, or the description of the test is not correct on the page.

Can you please provide your code and a link to the challenge?

Yes, I can.


The challenge link.

My code, though I’ve added a console.log(sum) before all of the other code:

// Example
var sum = 0;
function addThree() {
  sum = sum + 3;

// Only change code below this line

function addFive() {
  sum += 5
// Only change code above this line
var returnedValue = addFive();

Maybe the test is alright, but the instructions need something about calling addThree also.