我一直在试图调试一个脚本,当我在编写代码时,我发现问题的根源可能是我使用的Array.prototype.find()方法在当前版本的Google Apps脚本中完全不受支持(如2017年3月4日)。我怀疑这样做的原因是因为下面的代码,我试图在两种不同的环境中运行:如何查找我的Web浏览器支持的JavaScript版本?
// ran this locally on Chrome version 56.0.2924.87 (64-bit)
// result is 3
var t = [1,2,3,4];
var x = t.find(function(v) {
return v == 3;
});
document.write(x);
==========
// ran this on Google Apps Script (whatever the version is as of March 4th, 2017)
// attempting to run this function produces the error: "TypeError: Cannot find function find in object 1,2,3,4."
var t = [1,2,3,4];
var x = t.find(function(v) {
return v == 3;
});
Logger.log(x);
的唯一结论,我可以借鉴从这个实验中可以看出,Google Apps脚本基于过时的JavaScript版本,这导致了我的主要问题:我如何才能找到哪种版本的技术(无论是JavaScript还是HTML,或CSS等)通过Chrome网络浏览器和Google Apps脚本?我怎样才能最好地让自己知道任何重大变化?
很好的资源!感谢你的分享。 – Manuel