Given that I have the array [1,2,3,4,5,6,7,8,9,10]
what is the shortest way to grab a slice of 2 elements at a time while making sure that there is an overlap between each slice. For example:
Expected result
[1,2]
[2,3]
[3,4]
[4,5]
[5,6]
[6,7]
[7,8]
[8,9]
[9,10]
[10,nil]