A summary of the method of array
Will change the original array
Push, Unshift method, return length. Added is worth the return length, the other returns that element
Pop,shift returns the element
Reverse returns the element
Splice (Start,deletecount,additem ...), removed and added from the original array, returns the deleted array
Will not change the original array, return the new array
Concat,join,slice (Start,end)
Remember that these 3 are returned to the new array, others will change the original array
Ii. Summary of the methods of sting
Does not change the original value, it returns a new string or other value.
1, it is necessary to remember that String.match (RegExp without G) and regexp.exec (string) the same result.
If you are grouping with captures, subscript 0 matched substrings, subscript 1 grouped 1 captured text
If marked with G, String generates an array that contains all the matches (except for the capture groupings); The regular exec, which can be judged by step down, is not null.
Reg has all the lastindex.
2, String.slice (start,end), the end parameter is equal to the last character you want to take position +1, if you want to start from position p of the nth characters, use String.slice (p,p+n)
String.substring and Array.slice methods.
3, for the replacement or grouping can be used regular
String.Split (separator,limit), limit can limit the number of fragments to be divided, just as there is no G
String.Replace (Searcdhvalue,replacevalue), searcdhvalue with G, replaces all matches, and if not, replaces only the first match.
If it is a string, the value is replaced at the first occurrence
Learning is a step-by-step process, Non-stop Summary, Non-stop Learning, will have a qualitative breakthrough, has recently been summing up some of the things about JavaScript, I hope that they and everyone can be a step up.