The second of three methods for extracting a part of a string is the substring(start, end), which is similar to slice(). Substring method will return the same value, as if you used the slice method:
var str = "Apple, Banana, Kiwi";
var res = str.substring(7,13); The result of res will be Banana
And like the slice method, if you omit the second parameter, substring() will slice out the rest of the string giving you the same answer: