Title1

Title2

Title3

8-3 JavaScript ES6 Class (類別)

  1. 教學:Shubo 的程式教學筆記
    https://shubo.io/javascript-class/

class Sheet{
  constructor(){
    this.ss = SpreadsheetApp.getActiveSpreadsheet();//取得試算表
  }
  ws(sheet){
    return this.ss.getSheetByName(sheet);//取得工作表
  }
}

function ex3(){
  let ss = new Sheet();
  let ws = ss.ws('工作表1');
  
  let rowIndex = 1;
  let colIndex = 1;
  let range = ws.getRange(rowIndex,colIndex, 1 ,ws.getLastColumn());//範圍
  let values = range.getValues();
  let head = values[0];
  console.log(head);

}