Can I ask what the difference is between string object slice() and substr() in JavaScript?
slice()
substr()
I think the difference between str.slice() and str.substr() is the second parameter:
str.slice()
str.substr()
.slice() takes EndIndex while .substr() takes length as in:
.slice()
.substr()
.slice(StartIndex,EndIndex) and .substr(StartIndex,length).
.slice(StartIndex,EndIndex)
.substr(StartIndex,length).