example on how to create a slice up to the array end