Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <body> <p id="element"></p> <script> var myArray = ["a", "b", "c", "d"]; myArray.splice (myArray.indexOf('c'), 2); document.getElementById("element").innerHTML = myArray; </script> </body> </html>