```
// three functions to prove that every item in arr is true
// one works and two do not
const arr = [true, true, true, true, false, true];
function areAllTrueGood(arr) {
for (let i = 0; i < arr.length; i++) {
if (arr[i] === false) {
return false;
}
}
// if none false, then return true
return true;
}
// false! - correct, all items are NOT true
console.log(areAllTrueGood(arr));
function areAllTrueBad(arr) {
for (let i = 0; i < arr.length; i++) {
if (arr[i] === true) {
return true; // returns on first true element
}
}
return false;
}
// true? - wrong, all items are NOT true
console.log(areAllTrueBad(arr));
function areAllTrueReallyBad(arr){
// forced to return something on first iteration
// without checking any other elements
for (let i = 0; i < arr.length; i++) {
if (arr[i] === false) {
return false;
}else{
return true;
}
}
}
// true? - wrong, all items are NOT true
console.log(areAllTrueReallyBad(arr));
```