Learn
Arrays

pop Method

Now that we can push() items into an array, let's pop one off, using pop().

pop() is similar to push(), except that it deletes the last item of an array. Here's an example:

var bucketList = ['item 0', 'item 1', 'item 2'];

bucketList.pop();

console.log(bucketList); 
// Output: [ 'item 0', 'item 1' ]

Notice that 'item 2' was deleted from the end.

Community Forums
Get help and ask questions in the Codecademy Forums
Report a Bug
If you see a bug or any other issue with this page, please report it here.