/**
JS 靜態方法
*/
class Sheet{
static getWs(sheet){
return SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheet);//取得工作表
}
static getHead(sheet){
let ws = this.getWs(sheet);
let data = ws.getSheetValues(1,1,1,ws.getLastColumn())[0];
return data;
}
}
function ex3(){
// let ws = Sheet.getWs('工作表1');
let head = Sheet.getHead('工作表1');
console.log(head);
}