Removing elements
So far, you have learned how to add elements in the array. Let's look at how we can remove a value from an array.
Removing an element from the end of the array
To remove a value from the end of an array, we can use the pop method:
numbers.pop(); // number 13 is removed
The pop
method also returns the value that is being removed and it returns undefined
in case no element is being removed (the array is empty). So, if needed, we can also capture the value that is being returned into a variable or into the console instead:
console.log('Removed element: ', numbers.pop());
The output of our array will be the numbers from -4 to 12 (after removing one number). The length (size) of our array is 17.
The 
push
 and pop
 methods allow an array to emulate a basic stack
 data structure, which is the subject of the next chapter.
Removing an element from the first position
To manually...