JavaScript Substring function returns the part of the provided string starting from the specified index. By default JavaScript substring function returns the substring starting from the specified index to the end of provided string. Lets try the following sample code to understand the functionality: