The slice() method extracts a substring and returns a new string. The syntax for slice() method is string.slice( firstindex [, endindex] ); firstindex : -The zero-based index at which to begin ...