Working fine for false statements but not for true ones…help
function checkPositive(arr) {
// Add your code below this line
var positive=arr.every(function(isPositive){
if (isPositive >0){
return true;
}else{
return false;
}
});
// Add your code above this line
}
checkPositive([1, 2, 3, -4, 5]);
I’ve edited your post for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.