Hi there,
I'm looking to create a numerical array in Arcade to be used for numerical calculations later in my function.
I have an upper threshold for example :
var threshold = 4
I simply want to create a numerical array starting from 0 and looping through to 4 to produce:
[0,1,2,3,4] saved as an accessible numerical array.
This is a simple enough concept in R (Seq function) or Python (range function), but I'm scratching my head as to how to do this simple task using Arcade.
Any help would be greatly appreciated.
There's nothing built-in that does this, but you could easily create your own function:
function sequence(threshold){
var out_arr = []
for (var n=0; n <= threshold; n++){
Push(out_arr, n)
}
return out_arr
}
That's perfect thanks Josh 😄