Basic JavaScript - Understanding Undefined Value returned from a Function

Tell us what’s happening:
Hello beautiful people
I am stuck on the last part of this test as I don’t know what code to put in to get them to add together to equal 8 in the console log.

Your code so far

// Setup
let sum = 0;

function addThree() {
  sum = sum + 3;
}

// Only change code below this line
function addFive() {
  sum = sum + 5
}

// Only change code above this line

addThree();
addFive(); 

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Understanding Undefined Value returned from a Function

Link to the challenge:

I think you are missing a semicolon in your addFive function (look at addThree as an example)

2 Likes

Yes! you are correct and I got all Ticks on test run but still only got 50 % pass rate on the test.

I think the 50% is about the percent completed of the course.

Yes just reliased this haha I started this months ago and only getting back into recently so im rusty

thank you for your help much appericated

1 Like