I am wondering how you can write the Array.every() function yourself, with a for loop. In my example the for loop will print true 5 times for each iteration. How can I make it return true just once if all values pass, like the Array.every() function?
var array = [1,2,3,4,5];
console.log(array.every(function(num){return num < 6}))
// the for loop will return true 5 times
for(i=0;i<array.length;i++){
if(array[i] < 6)
console.log(true)
}