Tests if the start and end indexes are a safe range for the given array.
The array to check.
The start index.
The end index.
Optional
Throw an error if the range is out of bounds. Default false.
Tests if the start and end indexes are a safe range for the given array.