What is the difference between String.slice and String.substring?

slice() works like substring() with a few different behaviors. What they have in common: If start equals stop: returns an empty string If stop is omitted: extracts characters to the end of the string If either argument is greater than the string’s length, the string’s length will be used instead. Distinctions of substring(): If start > stop, then substring will swap those 2 arguments. If either argument … Read more