If I understood what you want, you can use
application.index(arr, a, 0)
to get all values from 1 to b for item a of the array, and pass that as a new array.