0

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

4replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
    • Sean
    • Sean
    • 4 yrs ago
    • Reported - view

    It might be an array, but the only funtions I could get to work with my test array are item() and slice().

    Like
    • JCSchell
    • JCSchell
    • 4 yrs ago
    • Reported - view

    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.

    Like
    • Sean
    • Sean
    • 4 yrs ago
    • Reported - view

    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.

    Like
Like Follow
  • 5 mths agoLast active
  • 4Replies
  • 2965Views
  • 1 Following