Dropping items from an array

What is the best way to drop items from an array ? For now, i'm going through the array , copying each element to a secundary one, giving it a slot tag. When the new array length reaches 27, I stop. I then copy this new array into a shulker box and use the /loot command to get its content.

Continue to help post