We can remove the last element of an array from being output ID by using the pop method
in this case
the last element is mango.
This will no longer be presented in our output
as you can see in our web browser.
Mango is not output it
in order to remove the first word instead or the first element we can use the shift method.
Now when we save our file and refresh our web browser you'll see that mango reappears but Apple has
been removed
to add a new element to the end of an array.
We can use the push method
in this case we'll add the word cherry to the very end of our output
and you can see that we now have a new element that has been output it
to add a new element to the beginning of an array.
We can use the UN shift method
we can see that the element Cherry has now been added to the beginning of the array.