array

This module defines utility functions for Array values manipulation.

Functions

resize(arr, size)

Ensures the size of an array is at least the one provided.

ArgumentDescription
arrThe array to resize
sizeAn integer with the new size

lookup(arr, index)

Returns the value stored at a given index for a given array without rising any error if the index does not exist. @return The requeste value if present, null otherwise

ArgumentDescription
arrThe array
indexThe index to lookup

delete(arr, start, end)

Removes one or more elements from an array, resizing it if necessary.

ArgumentDescription
arrThe array
startThe index of the first element to remove
endThe index of the last element to remove

Returns: true on success, false otherwise