How do you make an array?

I’m using Wick Editor 1.19.3 and I can’t figure out how to make an array. I just want it so that multiple numbers can be stored in one variable. I’ve tried:

example = [1, 2, 3, 4, 5];

Any help will be appreciated. Here’s the file: RythmTest3-7-2021_7-57-22.wick (1.7 KB)

I remember @bluecake creating an array tutorial on the forums… wait, here it is:

Let me try to give you some quick examples of how to use array’s here:

// How to create an array:
var Array1 = [1,2,3,4,5]    // Example 1
var Array2 = [6,7,8,9,10]  // Example 2

// How to see if an array contains something
if(Array1.indexOf(2)!==-1){ // Should return true
}

// How to see how big an array is
Array1.length // Expected value: 5

// How to remove the last variable in an array...
Array1.pop() /* Expected array1 value now:    [1,2,3,4,5]       */

/* How to add a variable to the end of an array */
Array1.push(5) /* Old array: [1,2,3,4]   New array: [1,2,3,4,5]  */

/* How to refer to a value in an array */
Array1[0] // Value: 1
Array1[1] // Value: 2
Array1[2] // Value: 3

// How to combine two arrays
var Array3 = Array1.concat(Array2) // Array3 should equal to [1,2,3,4,5,6,7,8,9,10]


























// etc.

I also just looked online, this link should help you with arrays:

1 Like