First, string interception

The slice method returns a fragment of a string.


























2. The substring method returns a substring at the specified position in the String.





























3. The substr method returns a substring of the specified length starting at the specified position.


























4, split into substrings and return the result as an array of strings.


























Array interception

1, the slice











2, splice












Not surprisingly, that’s what Splice intended.














3, sort the numbers




















There are string array and other web front-end technology articles, please pay more attention to!