type
returns
Method
`string``
name
description
A
number
The starting position to slice from
B
number, optional
The position to end the slice. If omitted this slices to the end. If negative, it will refer to the position from the end
The .slice function returns a substring from two given indexes of the original string.
.slice
"foo".slice(1, 2) == "o" "0123".slice(0, -1) == "012"
Last updated 5 years ago
Was this helpful?