It will create a slice of the value (array/string) from start, up to, but not including, end.
value
start
end
1.0.0
slice([0, 1, 2, 3, 4, 5], 2);// => [2, 3, 4, 5] Copy
slice([0, 1, 2, 3, 4, 5], 2);// => [2, 3, 4, 5]
slice([0, 1, 2, 3, 4, 5], 2, 5);// => [2, 3, 4] Copy
slice([0, 1, 2, 3, 4, 5], 2, 5);// => [2, 3, 4]
slice("012345");// => "012345" Copy
slice("012345");// => "012345"
slice("012345", 2, 4);// => "23" Copy
slice("012345", 2, 4);// => "23"
It will create a slice of the
value
(array/string) fromstart
, up to, but not including,end
.