array[2:4]
array[2:]
string[2:4]
string[:4]
Other languages use ..
or ...
instead of :
.
It also can:
array = [1, 2, 3, 4, 5, 6, 7, 8, 9]
array[2:8] = [100] // [1, 2, 100, 9]
array = [1, 2, 3, 4, 5]
array[2:4] = [100, 101, 102, 103, 104] // [1, 2, 100, 101, 102, 103, 104, 5]