【发布时间】:2017-12-28 14:17:17
【问题描述】:
我已经成功地对我的一些只需要 1 个输入范围的谷歌脚本函数进行了优化。
我试图将 1 个数组(姓名)和 2 个值(日期和学校名称)或 3 个数组作为输入。
代码如下:
// input - array of names like this 'Jon Snow'
// date - date with format like this '2017-12-28'
// school name like this 'School name'
function Allanswers(input, date, school) {
if (input.map) { // Test whether input is an array.
return input.map(function(x, date, school){ // Recurse over array if so.
return Allanswers(x, date, school)
});
} else {
return date; // returns 0
// the function is much more complicated but with this line I am checking if the value of date is taken from google spreadsheet
}
}
【问题讨论】:
标签: javascript optimization google-apps-script google-sheets custom-function