0

<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Arrays</h1>
<h2>The pop() Method</h2>

<p>The pop() method removes the last element from an array.</p>

<p id="workingcode1"></p>
<p id="workingcode2"></p>

<script>
const hero = ["Antman","Spiderman","Superman","wonderwoman"];
document.getElementById("workingcode1").innerHTML = hero;
hero.pop();
document.getElementById("workingcode2").innerHTML = hero;
</script>

</body>
</html>

Output
JavaScript Arrays
The pop() Method
The pop() method removes the last element from an array.

Antman,Spiderman,Superman,wonderwoman

Antman,Spiderman,Superman

Javascript pop() method
admin Changed status to publish December 19, 2023