Why do I get an error when using substring for the same array?
業(yè)精于勤,荒于嬉;行成于思,毀于隨。
Thesubstring() method is used to extract characters between two specified subscripts in a string.
Syntax: stringObject.substring(start,stop)
Cannot be used directly on arrays. Please refer to JavaScript substring() method
substring is used to operate strings. It is recommended to use slice instead.
splice is the value returned by deletion, oppArr has been changed and becomes empty;
splice(0) is to clear the array; slice(start, end) is to intercept the array and will not change the original array;
substring is to intercept the string Method