The .push() method :
We access the push method by using dot, connecting push to itemTracker. Then we can call push() like a function because it can take single or multiple arguments separated by commas.
This can also be called a destructive array method since it changes the initial array.
The .pop() method :
The array method .pop() removes the last item of an array. It does not take any argument.
Post a Comment