How to take a couple of elements from the end of an array using slice?
There is a valid array that I use in the loop. And I need to copy part of the array at each iteration, but from the end. For example, when i = 0 I need to copy part of the array from the end [20, 10,30,10,10,15,35] only this part, to i(20) And so on: i = 1 - I copy [20, 10, 30,10,10,15,35] to i . I can not correctly write inside and out.
arr = [20,10,30,10,10,15,35]