arrayObj.splice(start, deleteCount, [item1[, item2[, . . . [,itemN]]]])
arrayObj
Required. An Array object.
start
Required. The zero-based location in the array from which to start removing elements.
deleteCount
Required. The number of elements to remove.
item1, item2,. . ., itemN
Optional. Elements to insert into the array in place of the deleted elements.
arrayObj
Required. An Array object.
start
Required. The zero-based location in the array from which to start removing elements.
deleteCount
Required. The number of elements to remove.
item1, item2,. . ., itemN
Optional. Elements to insert into the array in place of the deleted elements.
//<![CDATA[
var ar=[];
for(var i=65, j=0; i<91; ar[j++]=String.fromCharCode(i++));
document.write('Array(): ',ar,'<p/>');
ar.shift()
document.write('ar.shift()','<br/>');
document.write('Array(): ',ar,'<p/>');
ar.unshift('unshift')
document.write('ar.unshift("unshift")','<br/>');
document.write('Array(): ',ar,'<p/>');
ar.pop()
document.write('ar.pop()','<br/>');
document.write('Array(): ',ar,'<p/>');
ar.push('push')
document.write('ar.unshift("push")','<br/>');
document.write('Array(): ',ar,'<p/>');
document.write('ar.slice(0,5)',ar.slice(0,5),'<br/>');
document.write('Array(): ',ar,'<p/>');
document.write('ar.splice(0,5)',ar.splice(0,5),'<br/>');
document.write('Array(): ',ar,'<p/>');
//]]>
</script>