The Concat () method in the array: Creates and returns a new array that is generated by adding all parameters to the array. It does not modify the array.
If the argument for the concat () operation is an array, then the element in the array is added, not the array.
var arr=[1,2,3var arr1=[4,5,6//[1,2,3,4,5,6]
The Join ("") method in the array is to convert each array element into a string and then concatenate the strings to insert the specified string or symbol between the two elements ...
The argument in parentheses refers to the character or string that is used to separate the elements of an array in the returned string, which is optional. If this argument is omitted, a comma is used as the delimiter.
The return value is:-A string that is generated by converting each element of the array into a string and then connecting the strings to insert a separator string between two elements.
var arr=[' C ', ' Z ', ' y '];console.log (Arr3.join ("+")); // Convert an array to a string C+z+y
Reverse () Method: Reverses the order of the elements in the array. It does this on the original array, which is to rearrange the elements of the specified array, but does not create a new array. If you have multiple references to an array, you can see the new order of the array elements through all references.
var arr=["Zhang San", "John Doe", "Harry"//["Harry", "John Doe", "Zhang San"]
This should be the case when you arrange the string upside down:
var str= "abcdef"; Console.log (Str.split (//f,e,d,c,b,a
Well, the basic usage of these three methods of the Savior is this, of course, can be used together, just like the last of this small example.
Of course, the situation in the project needs actual practical consideration ... That's it today!
Array Concat,join and Reverse methods