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
Did you try new Array(n) with a capital A?
function makeArray() {
var a = new Array(5);
Logger.log(a);
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With