Link Search Menu Expand Document

Understanding Undefined Value returned from a Function

Summary

  • If a return value doesn’t have a value, it is undefined.

Final Code

// Setup
var sum = 0;

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

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

// Only change code above this line

addThree();
addFive();