I've been trying to figure out this but for the longest time and I've got nothing. How do I fix this error, please help
function myFunction() {
var form = FormApp.openByUrl('form');
var allItems = form.getItems();
var doc = SpreadsheetApp.getActiveSpreadsheet()
var sheet = doc.getSheetByName("name");
var last = doc.getLastRow();
var data = sheet.getRange(1,1,last,8).getValues();
for(i=0,h=1; i<data.length, h<allItems.length;++i,++h){
if(data[i][2] == 0 && h==4){ //this where the error messages comes up for the "2"
var newText = allItems[h].asMultipleChoiceItem();
var title = newText.getTitle();
var newTitle = newText.setTitle(title+" (Sold out)");
}
}
}