checkIndex

fun checkIndex(index: Int, length: Int)

Checks if the given index is within bounds (0 until length).

Throws

if the index is out of bounds.