?
1.
Substring
The character used to extract a string between two specified subscripts
SUBSTRING (start,end)
Start and end position, zero-based index
The substring returned by the substring method includes the character at start, but does not include the character at end.
If start is equal to end, then the method returns an empty string (that is, a string of length 0).
If start is larger than end, then the method swaps the two parameters before extracting the substring.
If start or end is negative, it will be replaced with 0.
2.substr
The Substr method is used to return a substring of the specified length starting at the specified position.
Stringobject.substr (start [, length])
Start Required. The starting position of the desired substring. The index of the first character in the string is 0.
Length is optional. The number of characters that should be included in the returned substring.
If start is a negative number, then Start=str.length+start.
If length is 0 or negative, an empty string is returned.
If this argument is not specified, the substring continues to the end of the stringobject.
What's the difference between substr and substring in JavaScript?