Tell us what’s happening:
My current code has curly brackets around my function (with the boolean part), but it doesn’t output the correct answer for one array case. Why is that so?
Your code so far
function checkPositive(arr) {
// Only change code below this line
return arr.every(elem => {elem >0})
// Only change 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/110.0.0.0 Safari/537.36 Edg/110.0.1587.69
Challenge: Functional Programming - Use the every Method to Check that Every Element in an Array Meets a Criteria
Link to the challenge: