Please Explain - This Topic

Easy explanation needed on this topic.

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

// Setup
var sum = 0;

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

// Only change code below this line
function addFive() {
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/92.0.4515.159 Safari/537.36

Challenge: Understanding Undefined Value returned from a Function

Link to the challenge:

what kind of explanation do you need? what do you understand?

Thank you very much for your response. Actually nothing is understood in what is given as an explanation on this topic on FCC.

do you mean the value returned being undefined?

A function always return something, if you don’t define what it is returned with the return keyword, then the output of the function is undefined.

the purpose of the challenge is to distinguish two types of functions, based on wether they return a value or just run some mechanics in our program. Very often you would use functions to get a specific value, where they would return that value. At other ocassions, like in the exercise, they dont return anything and are only meant to execute some code

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