Https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/understanding-undefined-value-returned-from-a-function

Tell us what’s happening:
Ive tried everything I can but nothing seems to be working. heres my code
Your code so far
function addFive (){
sum += 5;
}
addFive();


// Setup
var sum = 0;

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

// Only change code below this line
function addFive (){
 sum += 5;
}
addFive();
// 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/89.0.4389.114 Safari/537.36.

Challenge: Understanding Undefined Value returned from a Function

Link to the challenge:

Hi @Brightstar10 !

Welcome to the forum!

You don’t need to call the function twice.
You wrote it once here

and it was already being called here

Delete that first one and the test will pass.

1 Like

Thank you so much, that was very helpful

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.