使用let在Google表脚本编辑器上声明变量 [英] Declaring variables on Google sheet script editor using let

查看:80
本文介绍了使用let在Google表脚本编辑器上声明变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用初始化变量时,让我收到此错误提示:缺少;在声明之前。

Whe I try to initialize variable using let I get prompted by this error: Missing ; before statement.

如何在Google表格脚本编辑器上使用 let 声明变量?

How to declare variables using let on Google sheet Script editor?

推荐答案

从ECMAScript 2015(ES6)添加。但遗憾的是,Google Apps脚本尚不支持ES6。因此,当在脚本编辑器中使用 let 时,在当前阶段,会发生错误。

let 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.

很多用户希望将ES6添加到Google Apps脚本中。 https://issuetracker.google.com/issues/36764074

A lot of users want that ES6 is added to Google Apps Script. https://issuetracker.google.com/issues/36764074

  • ECMAScript
  • let
  • Basic JavaScript features

如果我误解了你的问题,我很抱歉。

If I misunderstand your question, I'm sorry.

这篇关于使用let在Google表脚本编辑器上声明变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆