Javascript examples for Array:Quiz
splice() method takes 2 parameters: the index position to start at, and the number of elements to remove.
Remember that array indexes start with 0.
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var myArray = ["Javascript", "HTML", "CSS", "SVG"]; myArray.splice(1, 2);//from w w w .j a v a 2 s. c o m document.getElementById("demo").innerHTML = myArray; </script> </body> </html>