A.valueof ()//Returns the array itselfA.tostring ()//Returns the string form of the arrayA.push (Value,vlaue ...)//used to add one or more elements at the end of the array and returns the length of the array after adding the new element. Pop ()//Used to delete the last element of the array and return the elementJoin ()//Use a parameter as a delimiter to return all array members to a string. If no arguments are supplied, the default is separated by commas. Concat ()//For merging multiple arrays. It adds the members of the new array to the end of the original array, and then returns a new array, unchanged from the original array. Shift ()//Used to delete the first element of the array and return the element. Unshift (value)//used to add an element at the first position in the array and returns the length of the array after adding the new element. Reverse ()//used to reverse the order of the elements in the array, returning the changed arraySlice (Start_index, upto_index);//Used to extract part of the original array, return a new array, and the original array is unchanged. The first argument is the starting position (starting at 0), and the second parameter is the terminating position (but the element itself is not included in the position). If the second argument is omitted, it is returned to the last member of the original array. A negative number indicates the penultimate part. Splice (index, Count_to_remove, AddElement1, AddElement2, ...);//Used to delete a member of the original array, and can be added to the new array member at the deleted location, and the return value is the element that was deleted. The first parameter is the starting position of the deletion, and the second parameter is the number of elements to be deleted. If there are more arguments later, it means that these are the new elements to be inserted into the array. Sort ()//array members are sorted by default in dictionary order. After sorting, the original array will be changed. If you want the sort method to be sorted in a custom way, you can pass in a function as a parameter, which means sorting by custom method. The function itself accepts two parameters, representing two elements for comparison. If the return value is greater than 0, the first element is ranked after the second element, and in other cases, the first element is preceded by the second element. Map ()all members of the array call a function in turn, returning a new array based on the result of the function. Map (Elem,index,arr)The //map method accepts a function as a parameter. When the function is called, the map method passes it to three parameters, namely the current member, the current position, and the array itself. ForEach ()//Iterate through all the members of an array, perform an operation, and the parameter is a function. It accepts three parameters, the value of the current position, the number of the current position, and the entire array. Filter ()The //parameter is a function in which all array members execute the function sequentially, returning a new array of members that return a result of true. The method does not change the original array. Some ()//used to determine if an array member conforms to a certain condition. Takes a function as an argument, and all the array members execute the function sequentially, returning a Boolean value. The function takes three parameters, in order, the member of the current position, the ordinal of the current position, and the entire array. As long as the return value of an array member is true, the return value of the entire some method is true, otherwise false. Every ()//used to determine if an array member conforms to a certain condition. Takes a function as an argument, and all the array members execute the function sequentially, returning a Boolean value. The function takes three parameters, in order, the member of the current position, the ordinal of the current position, and the entire array. The return value of all array members is true to return true, otherwise false. Reduce ()each member of the array is processed sequentially, and eventually accumulates as a value. Left-to-right processing (from the first member to the last member)Reduceright ()each member of the array is processed sequentially, and eventually accumulates as a value. Right to left (from the last member to the first member)IndexOf (s)Returns the position of the first occurrence of the given element in the array, or 1 if it does not appear. Can accept the second parameter, which indicates where the search beginsLastIndexOf ()Returns the position of the last occurrence of the given element in the array, or 1 if it does not appear. |