Returns a new string containing a section of the string.
slice(start?, end?)
start optional
The start index. If negative, the index of the code point to start from, counting back from the last code point. If not specified, the substring starts at index 0.
end optional
The end index. The substring includes the code points up to, but not including, the code point indicated by end. If this value is not specified, the substring continues to the end of the string.
A string.
"Green Day".slice(6)
"Day"
"Green Day".slice(0, 5)
"Green"
"Green Day".slice(-3)
"Day"
"Green Day".slice()
"Green Day"