google apps script - Using the contents of an array outside a function -
is there possibility use contents of array in function? example, have following code:
var locations = []; function values() { var values = ['test1','test1'] (i in values) { locations.push(values[i]); } } logger.log(locations)
now logs nothing, if place logger in function, returns contents of array.
call function values(); this
var locations = []; values(); function values() { var values = ['test1','test1']; (i in values) { locations.push(values[i]); } } logger.log(locations);
Comments
Post a Comment