Slice

Arguments

Explanation

The .slice function returns a substring from two given indexes of the original string.

Examples

"foo".slice(1, 2) == "o"
"0123".slice(0, -1) == "012"

Last updated