Tell us what’s happening:
Your code so far
function checkPositive(arr) {
// Add your code below this line
arr.every(function(currentValue) {
return currentValue > 0;
})
// Add your code above this line
}
checkPositive([1, 2, 3, -4, 5]);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/functional-programming/use-the-every-method-to-check-that-every-element-in-an-array-meets-a-criteria/
I don’t know why but my code is not passing the test when checkPositive([1, 2, 3, 4, 5]) is called. when I check this on the browser console it works fine. Any help please?