var splice_arr = ['tokyo','nagoya','osaka']; document.write(splice_arr + '<br>'); var splice_arr2 = splice_arr.splice(1,2,'fukuoka'); document.write(splice_arr + '<br>'); document.write(splice_arr2);
See the Pen js: Array.prototype.splice() by nwstcode (@nwst) on CodePen.