Using the splice() method to insert elements : Splice : Array JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Array » Splice »

 

Using the splice() method to insert elements

















<html>
<head>
<title>Using the splice() method to insert elements</title>
<script type="text/javascript" language="javascript">
<!-- //
function SpliceArray(){
    var x = new Array("a","d""e""f");
    var xj = x.join(", ");
    alert(xj);
    alert(x.length);

    x.splice(10"b""c");
    var xj = x.join(", ");

    alert(xj);
    alert(x.length);
}
// -->
</script>
</head>
<body onload="SpliceArray()">

</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Array
» Splice