Skip to content

Instantly share code, notes, and snippets.

@unknownuser88
Created January 6, 2014 13:25
Show Gist options
  • Save unknownuser88/8282862 to your computer and use it in GitHub Desktop.
Save unknownuser88/8282862 to your computer and use it in GitHub Desktop.
slice(start, [end]) Returns a substring of the string based on the “start” and “end” index arguments, NOT including the “end” index itself. “End” is optional, and if none is specified, the slice includes all characters from “start” to end of string.
//slice(start, end)
var text="excellent"
text.slice(0,4) //returns "exce"
text.slice(2,4) //returns "ce"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment