Substr function of JavaScript also returns the part of a string of specified length starting from the start index. Here specified length means it returns the number of characters.
Substring function of JavaScript returns the part of a string starting from the specified starting index to the specified ending index of the provided string.