How do I get the sourrounding (first, and last) 3 values for a range in typescript? ([1, 2, 3, 4, 5, 6, 1, 2, 3], 1, 2, 3 are the parts I wanna get)