First, find the position of the element item in the given array arr, otherwise return-1
Find robust code for the position of an element two, calculate the sum of the given array elements (the element is number type)
There are many ways to do this, such as regular loops, recursion, foreach traversal, reduce accumulation, or even eval ().
Reduce is a special additive for the three, copy array
Slice (0) method is the simplest four, do not modify the original array, delete the same as the array value of the specified element
The easiest way to do this without modifying the original array is to use Fliter to return the filtered array
* In the above method, the push method and the Splice method will modify the called array itself, if the subject changes directly, then do not need to copy the original array and then perform the operation.
Add elements after the array and do not modify the array directly
Vi. Delete the last element without directly modifying the array
Merge arrays, do not modify arrays directly
Viii. the number of occurrences of the specified item in the statistics array
Nine, find repeating elements
Ten, ask for two Times Square
Xi. in the array arr, find all the locations where the element with the value equal to item appears
JS Common array of programming operations