admin管理员组文章数量:1315069
Pretty basic question but does anyone know how to create an empty array in Google Apps Script with a defined integer length n
. Tried new array(n)
but don't think its part of the Google Apps Script spec.
I know I can do it with with a loop (or manually typing it out) but wondered if there is a more elegant solution
Pretty basic question but does anyone know how to create an empty array in Google Apps Script with a defined integer length n
. Tried new array(n)
but don't think its part of the Google Apps Script spec.
I know I can do it with with a loop (or manually typing it out) but wondered if there is a more elegant solution
Share Improve this question edited Aug 14, 2019 at 19:14 Wicket 38.5k9 gold badges78 silver badges193 bronze badges asked Aug 14, 2019 at 17:27 Chris BarrettChris Barrett 6017 silver badges25 bronze badges1 Answer
Reset to default 10Did you try new Array(n)
with a capital A?
function makeArray() {
var a = new Array(5);
Logger.log(a);
};
本文标签: javascriptCreate empty array of length nStack Overflow
版权声明:本文标题:javascript - Create empty array of length n - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741971154a2407845.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论