Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Learning Tonight "ES6 standard entry (3rd Edition)" Chapter 8 - extension of the array and found a lot about the array of methods have almost forgotten quickly electricity at night to charge.
1. arr.push () length additive element from the rear, the return value is added after the array
2. arr.pop () to remove elements from the back, is only one element of the return value is deleted
3. arr.shift () to remove elements from the front, can only remove a return value is removed elements
4. arr.unshift () length from the foregoing additive element, the return value is added after the array
5. The arr.splice (I, n) deleted after n elements starting from I (index value), the return value is deleted element
6. The arr.concat () new array connected to two arrays, connected to the return value
7. The str.split () will be converted to an array of strings
8. The arr.sort () to sort the array, good return value is an array of rows, the default is sorted by the leftmost digit
9. The arr.reverse () array reversed, the return value is an array of the inverted
10. The arr.slice (start, end) cut index values start to end of the array index value, the index does not contain the end value, the return value is an array of cut out
11. The arr.forEach (the callback) to iterate, no return
callback parameters: value - the current value of the index, index - the index, array - the original array
12. The arr.map (the callback) through the array, a new array Returns
13. arr.filter (the callback) with arrays, returns an array to meet the requirements of
14. A arr.every (the callback) based on judgment condition whether the whole element of the array is satisfied, if yes return ture
15. A arr.some () based on the determination condition element, whether there is an array satisfied, if a return to meet ture
16. A arr.reduce (the callback, the initialValue) iterative array all, accumulators, each value (left to right) were combined in the array, a finally calculated value
callback parameters: previousValue Required - callback return value on a first call, or starting values (initialValue); currentValue Required - array item currently processed array; optional index - entry in the current array the index values in the array; optional array - source array; initialValue: optional - initial value
17. A arr.reduceRight (the callback, the initialValue) as in arr.reduce () function, except that, reduceRight () from the forward end of the array of the array do accumulate items in the array
18. A arr.indexOf () to find an element index value, if repeated, the index value is found in the first return; if not, it returns -1
19. The arr.lastIndexOf () As with arr.indexOf () function, except that the look from the back
20. The Array.from () two types of objects will be converted to an array of real
21. A Array.of () for converting a set of values into an array
22. The arr.copyWithin () within the current array, the array will copy the specified location to another location, the array will overwrite the original item, return to the current array
Parameters: target - Required index start position displaced from the array entries; start - optional index entry array is read from the start position, the default is 0, if negative, then read from right to left; end - optional index into an array of items in the position to stop reading, the default is Array.length, if it is negative, the reciprocal of
23. The arr.find (callback) to find the first array of items qualifying
24. The arr.findIndex (callback) to find the first qualifying array index value of the item
25. A arr.fill (target, Start, End) the given value, a filled array, the original array will change after filling
Parameters: target - the element to be filled; Start - starts filling position - index; End - the terminating filled - the index (not including this position)
26. A arr.includes () determines whether the array contains the given value
27. The arr.keys () keys to iterate
28. The arr.values () keys to iterate
29. The arr.entries () key names and values through the array
30. A arr.join () the group of elements of the array from a string (the original array unchanged), Comma Separated by default, which only receives a parameter: delimiters