Is google apps script synchronous?

后端 未结 3 704
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-06 10:08

I\'m a Java developer learning JavaScript and Google Apps Script simultaneously. Being the newbie I learned the syntax of JavaScript, not how it actually worked and I happil

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-06 10:49

    Please note that this hasn't really changed since the introduction of V8 runtime for google app scripts.

    While we are on the latest and greatest version of ECMAScript, running a Promise.all(func1, func2) I can see that the code in the second function is not executed until the first one is completed.

    Also, there is still no setTimeout() global function to use in order to branch the order of execution. Nor do any of the APIs provide callback functions or promise-like results. Seems like the going philosophy in GAS is to make everything synchronous.

提交回复
热议问题