Use the pop() method to remove the last item from the myArray array. - Javascript Array

Javascript examples for Array:Quiz

Description

Use the pop() method to remove the last item from the myArray array.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
var myArray = ["Javascript", "HTML", "CSS"];
myArray.pop();//from ww w . j av a  2  s  .  co  m
document.getElementById("demo").innerHTML = myArray;
</script>

</body>
</html>

Related Tutorials