Push usage
Push |
English [P??] |
Beauty [P??] |
Vt. |
By to promote or increase; Right... To exert pressure and persecution; Convince |
N. |
Push, resolve; Large-scale offensive; Committed to the pursuit of |
Definition and usage
The push () method adds one or more elements to the end of the array and returns the new length.
Grammar
Arrayobject.push (Newelement1,newelement2,...., newelementx)
return value
Adds the specified value to the new length after the array. (using document.write (arrayobject. push (Newelement1,newelement2,...., newelementx)) , Pop-up new arrayobject length value)
Unshift () method
Unshift |
English [? n '?? FT] |
Beauty [? n '?? FT] |
Vi. |
Loosen the font Shift key of the typewriter or keyboard; |
The Unshift () method adds one or more elements to the beginning of the array and returns the new length. (The Unshift () method does not work correctly in Internet Explorer !) )
Basically the same as the push method, but push is used for trailing increments
Pop () method
Pop |
English [p?p] |
Beauty [Pɑ:p] |
Vi. |
To appear (in the field, suddenly); to appear suddenly; To make a burst sound; (sudden) Action; |
Vt. |
To reach out (suddenly); (suddenly) raise a question; (Put something ready) out of the blue; Tap |
N. |
Pop music; Soda (especially as a salutation) dad; (of a quick mark); |
The Pop () method is used to delete and return the last element of the array.
Definition and usage
The Pop () method is used to delete and return the last element of the array.
Grammar
Arrayobject.pop ()
return value
The last element of the Arrayobject.
Description
The Pop () method removes the last element of the arrayobject, reducing the length of the array by 1, and returning the value of the element it deletes. If the array is already empty, pop () does not change the array and returns the undefined value.
The push () method adds its parameter order to the tail of the arrayobject. It modifies the arrayobject directly, rather than creating a new array. The push () method and the Pop () method use the advanced post-stack functionality provided by the array
The elements in the array increase the push usage unshift () method and the reduce pop () method