Read-only view of the current contents held in the array. This is a shallow-dereference through spread syntax, so any objects contained in the array are still mutable
Index of the most recently returned value from the ring
Adds a new value into the RingArray. This is similar to someArray.push(...values)
, but returns the RingArray for chaining.
The new values to append
The RingArray for chaining
Gets the entry of the source array at the given index. Like a direct index access (eg someArray[someIndex]
), will return undefined if the index is out of range.
Location in the array to return
An entry from the source array (if the index was in range), otherwise undefined
Inserts a new value into the RingArray at a specified location. This is similar to someArray.splice(idx, 0, value)
, but returns the RingArray for chaining.
The new value to insert
The position in which to insert the new value
The RingArray for chaining
Jumps the internal location of the RingArray to a new location and returns the RingArray for chaining.
Location in the array to use next
The RingArray for chaining
Gets the next entry of the source array, based on previous steps through the source. Initially this returns the first value (as if someArray[0]
) and continues
until reaching the equivalent of someArray[someArray.length - 1]
. At that point, the internal location wraps back to the start of the array.
The next entry from the source array
Removes the specified value from the RingArray. This is similar to someArray.splice(someArray.indexOf(value), 1)
, but returns the RingArray for chaining.
The value to remove
The RingArray for chaining
Removes the specified value from the RingArray. This is similar to someArray.splice(idx, 1)
, but returns the RingArray for chaining.
Location in the array to remove
The RingArray for chaining
Wrapper of the base
array
type in JavaScript to provide cyclic-based interactions