Solid understang to this challenge

i need a solid understanding to this challenge

  **Your code so far**

function addFive() {
sum += 5;
}

  **Your browser information:**

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

Challenge: Understanding Undefined Value returned from a Function

Link to the challenge:

What about it do you need help with?

how will the both function run??

There is only one function there. You run it by calling the function.

addFive();
1 Like

i have added it yet didn’t pass the challenge

The code you posted is correct.

BUT; make sure you add that code into the supplied code* :wink:

you mean i should add the existing code to my answer??

Before you started the lesson, this was the starter code.

// Setup
var sum = 0;

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

// Only change code below this line


// Only change code above this line

addThree();
addFive();

You are supposed to add the answer you wrote here

Inside the comment tags.

// Only change code below this line


// Only change code above this line

This is why it is important to share your FULL code in the forum and not just your answer :grinning:

2 Likes

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