Skrip Aplikasi Google Sheets Dapatkan sel terakhir memiliki nilai dengan sel kosong

const ss = SpreadsheetApp.getActive();
const sh = ss.getSheetByName('Sheet1')
const lrow = sh.getLastRow();
const Avals = sh.getRange("A1:A"+lrow).getValues();
const Alast  = lrow - Avals.reverse().findIndex(c=>c[0]!='');
Waleed Ahmed