I am using Apps Script with Google Sheets. I have written some code to get the value in a cell and save it to a variable. I then created an array with all those variables. I want to be able to look through the array and look for the word "fail" and return true if it is present or false if it is not present. It only has to match once in the array for it to be true.
This is what I have so far:
function myFunction() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var activeSheet = ss.getActiveSheet();
for(var i = 20;i<=120,i++){
var main = activeSheet.getRange(i, 8).getValue();
var state = activeSheet.getRange(i, 9).getValue();
var scroll = activeSheet.getRange(i, 10).getValue();;
var log = activeSheet.getRange(i, 11).getValue();
const testArray = [main, state, scroll, log];
//need some code here to look for the string "fail" in the array and if it is there, return true, otherwise return false.
}
}