1.push () and Unshift () returns the new array length after executing the method
When the pop () and Shift () methods are executed, the removed items are returned;
Shift () Gets the first pop () to get the last item
Push () adds item unshift () from the previous Add item
Memorizing method: The letter is short is to take an item, the letter is long is added, pop () is shorter than push (), so is to take, learn from each other;
Push () is added from the front. Unshift () is deleted from the back, the transmission parameters;
Pop () is the last item removed, and shift () removes the first item without parameters;
When the slice () method has only one parameter, the method returns all items that have the last value, including the final item,
When there are two parameters, the starting position (including) is returned to the item with the lowest value (not included).
Learn JS Basic article