Javascript code to remove last item from array using arr.pop()
Append one value
<script type="text/javascript"> var arr = ["v1", "v2", "v3"]; var lastItem = arr.pop(); arr.forEach (function(item, idx) { document.write("idx=" + idx + " item=" + item + "<br/>"); }); </script>