Question:
How does
myArr.splice(i, j)
differ from myArr.slice(i, j, myVar)
?Answer:
myArr.splice(i, j)
- removes j
elements from (and including) myArr
index i
myArr.splice(i, j, myVar)
- removes j
elements from (and including) myArr
index i
then adds myVar
in their place