Whe I try to initialize variable using let
I get prompted by this error: Missing ; before statement.
How to declare variables using let
on Google sheet Script editor?
Whe I try to initialize variable using let
I get prompted by this error: Missing ; before statement.
How to declare variables using let
on Google sheet Script editor?
1 Answer
Reset to default 14let
was added from ECMAScript 2015 (ES6). But, unfortunately, Google Apps Script doesn't support ES6 yet. So when let
is used in the script editor, in the current stage, the error occurs.
A lot of users want for ES6 to be added to Google Apps Script, It's on the feature requests, however, no progress seems to have been made.
https://issuetracker.google./issues/36764074
Reference :
- ECMAScript
- let
- Basic JavaScript features
If I misunderstand your question, I'm sorry.
Updated at February 12, 2020
Finally, the V8 Runtime has already been added to Google Apps Script. By this, let
can be used in Google Apps Script.
Please check the official document.