Personally, good afternoon.
I'm doing a function that has the same utility as ANY
.
What is the idea, is to know if it has any number smaller than the given in the function inside the array, regardless if it is in the first or last position of the array.
If exister returns TRUE
, otherwise, returns FALSE
The code looks like this:
const numerosFora = [1];
function qualquer (num1, func){
for(let i = 0; i < num1.length; i++){
for(let i = 0; i < func.length; i++){
if(num1[i] < func[i]){
return true
} else {
return false
}
}
}
}
console.log(qualquer([1,0],numerosFora))
But it only returns if the number is in the first position, in case 0.