x
1
2
<html>
3
<body>
4
5
<h2>JavaScript Remove Element From Array </h2>
6
<h2>splice()</h2>
7
<p>The splice() methods can be used to remove array elements:</p>
8
9
10
11
<script>
12
var courses= ["HTML", "CSS", "JS", "PHP"];
13
document.write("<b>" + courses+ "<b> <br>");
14
courses.splice(1 , 1);
15
document.write("<b>" + courses + "<b> <br>");
16
</script>
17
18
</body>
19
</html>