Working in the script editor of Google Sheets I have some for/of loops that USED to work, but now for the last few days just give error "Missing ; after for-loop initializer".
In this example I'm iterating through an HTTP response that I've converted tho JSON object. I'm looking for specific readings to add to the table if they are there. The error comes on the line that the loop is designated. The data I'm iterating through it as JSON response. Each item definitely includes the attributes I'm requesting (in this case 'name' and 'name.make'). I've read everything in the docs, in the Javascript docs I can find, both of the SO posts on this topic. Any help is appreciated.
function buildListOfAllEquipmentInOrg() {
var allMachines = getEquipmentFromMyjdForOrg();
var allMachinesJson = JSON.parse(allMachines);
var values = allMachinesJson.values;
var thisRow = 2;
var each;
var sheet = SpreadsheetApp.getActiveSheet();
// Interate through all of values...one per machine.
for (each of values) {
sheet.getRange(thisRow, 1).setValue([each.name]);
}
sheet.getRange(thisRow, 2).setValue([each.make.name]);
measurementsLink = extractMeasurementsLink(link);
}
getEquipmentFromMyjdForOrg()for(let each of values)instead).