slice method

Javascript slice() method:

Slice() method extracts a part of string and returns a new string without modifying the original string. It requires the index as start and end parameters for returning part of the string. Here negative index are allowed. Syntax: slice(indexStart) slice(indexStart, indexEnd) Here the parameter indexEnd is optional. indexStart – index of first character to include …

Javascript slice() method: Read More »