Having some difficulties with the code snippet provided here. It might be a basic question, but I'm unable to figure out what's going wrong.
The issue is that I'm trying to perform calculations on individual values in an array generated from a range, but I can't seem to access the elements of the array individually - only the entire array as a whole.
var myarray = sh.getRange("A3:L3").getValues();
for (var i = 0; i < my myarray.length; i++){
var test = myarray[0];
myarray[i] = myarray[i] + 10;
}
My question is, is it possible to modify the array elements within the for loop as shown in the second line (myarray[i] = myarray[i] + 10)? My intention is to replace each value with its current value increased by 10.
Despite my attempts, this approach doesn't seem to work and it keeps returning NaN (Not a Number).
In order to troubleshoot, I created a variable named "test" which displays the complete array instead of just the first element.
I'm currently at a standstill and I could really use some guidance on what may be causing the issue.
Appreciate any assistance you can provide!