Answers for "javascript substring vs slice"

8

javascript substring vs slice

The same except:
* if start > stop substring swaps the arguments, slice returns ""
* if argument is NaN or negative, substring will treat it as a 0
* if start is negative, slice sets char from the end of string
* if stop is negative, slice sets stop to string.length – Math.abs(stop)
Posted by: Guest on June-02-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language