Tell us what’s happening:
It’s an exercise.
requirements:
addFive should be a function
addFive should be a function
sum should be equal to 8
Returned value from addFive should be undefined
Inside of your functions, add 5 to the sum variable
Returned value from addFive should be undefined
Inside of your functions, add 5 to the sum variable
I don’t know what’s wrong with my code because it gives me an error on ‘sum should be equal to 8’.
Your code so far
// Example
var sum = 8;
function addThree() {
sum = sum + 3;
}
// Only change code below this line
function addFive(sum){
sum = sum + 5;
}
// Only change code above this line
var returnedValue = addFive(3);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
.
Link to the challenge: