An array orders values by sequential numeric integer keys.
local Replica = require(Path.To.Replica)
local myArray = Replica.Array.new({1, 2, 3})
Creates a new array replicant with an optional Config argument for controlling replication
Finds the index of a given value in the Array
Returns an ipairs iterator for values in the Array. Example:
for i, value in myData:Get("MyArray"):Ipairs() do
. . .
end
Returns the size of the array
Inserts a value into the array and replicates changes. If an index
argument is provided, all elements will be shifted over. Note that this could be costly, as every element shift must be replicated (each shift, however, will be collated)
Removes an element at some index of the array, and replicates a shift over for the rest of the array's elements. Like Insert
, this may be costly for larger arrays and shifts. It may be more beneficial to use Pop
or Replica.Map objects instead.
Inserts a value at the end of the array (equivalent to Insert if no index argument is provided) and replicates the change
Removes the item at the end of the array and replicates the change.