arrayname.pop() - pop removes the last element from an array and returns that element.
Arrayname.pop() - pop removes the last element from an array and returns that element. Example-
<html>
<body>
<script language=“javascript”>
var todolist=new Array()
todolist[0]=“book the waldorf for yourbirthday party” todolist[1]=“Give donald a call and invite him to your” todolist[2]=”wake up from your dream“
odolist.pop()
document.write(”length of array after pop “+todolist.length+“<br>”) document.write(”<b>Array after pop :</b> “+“<br>”) for(i=0;i<todolist.length;i++)
{
document.write(todolist[i]+”<br>“)
}
</script>
</body>
</html>
