How to append values to an array
How do you append a value to an array? The closest I get is:
var x := ["Hi", "there"];
var y := ["dude"];
x+y
but, while it dosen't have an error in it's code, it does not return an array
4 replies
-
It might be an array, but the only funtions I could get to work with my test array are item() and slice().
-
There is turning the array to text with concat() appending it and then making it back into an array with split() but it’s cumbersome.
-
let myArray1 := [1, 2, 3];
let myArray2 := [4, 5, 6];
let myArray3 := myArray1 + myArray2;
let myArray4 := [item(myArray3, 0), item(myArray3, 1), item(myArray3, 2), item(myArray3, 3), item(myArray3, 4), item(myArray3, 5)];
alert(text(last(myArray4)))All the Ninox functions worked doing this and myArray4 could probably be initialized using a loop. Still, kind of cumbersome. I tried using concat() on myArray3 and all I got back was a single string of 123456.
-
maybe this helps?: https://docs.ninox.com/en/script/functions/array
Content aside
- 11 mths agoLast active
- 4Replies
- 3080Views
-
1
Following