// Shift: Delete the first entry of the original array and return the value of the deleted element. If the array is empty, undefined is returned.
VaR A = [1, 2, 3, 4, 5];
VaR B = A. Shift (); // A: [2, 3, 4, 5] B: 1
// Unshift: add the parameter to the beginning of the original array and return the length of the array.
VaR A = [1, 2, 3, 4, 5];
VaR B = A. unshift (-2,-1); // A: [-2,-,] B: 7
// Note: In ie6.0, the test return value is always undefined, and in ff2.0, the test return value is 7. Therefore, the return value of this method is unreliable. You need to use splice instead of this method when returning the value.
// POP: Delete the last entry of the original array and return the value of the deleted element. If the array is empty, undefined is returned.
VaR A = [1, 2, 3, 4, 5];
VaR B = A. Pop (); // A: [1, 2, 3, 4] B: 5
// Push: add the parameter to the end of the original array and return the length of the array.
VaR A = [1, 2, 3, 4, 5];
VaR B = A. Push (6, 7); // A: [1, 2, 3, 4, 5, 6, 7] B: 7
// Concat: returns a new array consisting of adding parameters to the original array.
VaR A = [1, 2, 3, 4, 5];
VaR B = A. Concat (6, 7); // A: [1, 2, 3, 4, 5] B: [1, 2, 3, 4, 5, 7]
// Splice (START, deletecount, val1, val2,): Delete the deletecount item from the start position, and insert val1, val2,
VaR A = [1, 2, 3, 4, 5];
VaR B = A. splice (, 9); // A: [,] B: []
VaR B = A. splice (0, 1); // same as shift
A. splice (0, 0,-2,-1); var B = A. length; // same as unshift
VaR B = A. splice (A. Length-1, 1); // same as pop
A. splice (A. length, 7); var B = A. length; // same as push
// Reverse: returns the reverse order of the array.
VaR A = [1, 2, 3, 4, 5];
VaR B = A. Reverse (); // A: [5, 4, 3, 2, 1] B: [5, 4, 3, 2, 1]
// Sort (orderfunction): sorts arrays by specified parameters.
VaR A = [1, 2, 3, 4, 5];
VaR B = A. Sort (); // A: [1, 2, 3, 4, 5] B: [1, 2, 3, 4, 5]
// Slice (START, end): returns a new array consisting of items from the specified start subscript to the end subscript in the original array.
VaR A = [1, 2, 3, 4, 5];
VaR B = A. Slice (); // A: [, 5] B: [, 5]
// Join (separator): groups the elements of the array into a string that uses the separator. If this parameter is omitted, a comma is used as the Separator by default.
VaR A = [1, 2, 3, 4, 5];
VaR B = A. Join ("|"); // A: [1, 2, 3, 4, 5] B: "1 | 2 | 3 | 4 | 5"