String.prototype.slice

Returns a new string containing a section of the string.

Syntax

slice(start?, end?)

Parameters

Return value

A string.

Examples

"Green Day".slice(6)
"Day"
"Green Day".slice(0, 5)
"Green"
"Green Day".slice(-3)
"Day"
"Green Day".slice()
"Green Day"