Home > Mobile >  How to use static method in google app script
How to use static method in google app script

Time:09-17

In google app script,static is not a keyword,how to use this method in google app script?

class Test{
  constructor(a){
    this.a = a;
  }
  static trythis(b,c){
    return b*c;
  }
}


function test123(){
  let test = new Test(123)
  Logger.log(test)
  let test2 = trythis(2,3)
  Logger.log(test2)
} 

ReferenceError: trythis is not defined

enter image description here

  • Related