Basic JavaScript - Understanding Undefined Value returned from a Function

Tell us what’s happening:
I typed console.log but it didnt present a result why

Your code so far

// Setup
let sum = 0;

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

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

// Only change code above this line

addThree(5);
addFive(5);
console.log(addFive)

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0

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

Link to the challenge:

You are just console logging what addFive is, which is a function. If you want to log what it returns (or in this case doesn’t) you need to call it like this, addFive().

thanks a lot for your help

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