Remove the last item from an array (and not return item)

arrays, javascript

Solution

`pop()` function also removes last element from array, so this is what you want(Demo on JSFiddle):

var abc = ['a', 'b', 'c', 'd'];
abc.pop()
alert(abc); // a, b, c

Problem

My current array: `abc = ['a', 'b', 'c', 'd'];` I understand `.pop()` remove and returns the last item of an array, thus: `abc.pop(); = 'd'` However, I want to remove the last item, and return the array. So it would return: `['a', 'b', 'c'];` Is there a JavaScript function for this?

Original source

Related problems