I followed their example literally exactly how they wrote it.
function checkPositive(arr) {
// Only change code below this line
arr.every(function(number){
return number > 0;
});
// Only change code above this line
}
checkPositive([1, 2, 3, -4, 5]);
function checkPositive(arr) {
// Only change code below this line
arr.every(function(number){
return number > 0;
});
// Only change code above this line
}
console.log(checkPositive([1, 2, 3, -4, 5]));
What is the result logged to the console?
Answer:
The function’s return value is undefined. You have two functions there, the checkPositive function and the callback function. Both should have return values.
Side note: See how number is a funny color? That’s telling you that number is a keyword and should not be used as a variable name.