小编Mas*_*ask的帖子

Calling another function after value is not working

I have a simple code to call a value from another function and its not working :

function ABC() {
  var ID = XYZ(id);
  Logger.log(ID); //throws error not defined.
}

function XYZ(id) {
  var id = "1234"
  return id;
}

Run Code Online (Sandbox Code Playgroud)

What I wan to do is capture the value of id from function XYZ and Logger.log it into function ABC. But this reflects error.

javascript

1
推荐指数
1
解决办法
43
查看次数

如何对二维数组进行切片?

我有一个数组说

arr1 = [[1,2,3,4],[5,6,7,8],[9,10,11,12]]
Run Code Online (Sandbox Code Playgroud)

我想将其切片并选择第二列和第三列。

我尝试过使用切片,但没有成功。

var result = arr1.slice(1,3);

但我没有得到想要的输出

[[2,3],[6,7],[10,11]]
Run Code Online (Sandbox Code Playgroud)

是因为我使用 Google 电子表格收集数据吗?

javascript google-apps-script

0
推荐指数
1
解决办法
1465
查看次数

标签 统计

javascript ×2

google-apps-script ×1