console.log(str);
Str is a string?
Output the type of your str to see split is a string method
Is str itself not a string? split is a method in a string
Confirm whether str is a String Object. Split is a function, that’s right
split() is a method of String. The str you print out is obviously an array
Your str is not a string type number, and the split method does not exist in arrays.
It should be a method under a certain class, a method under string. Can’t be taken out separately, use it directly
Convert arr to string, then use this method
You should first convert arr to string and then use split
Str is a string?
Output the type of your str to see
split is a string method
Is str itself not a string? split is a method in a string
Confirm whether str is a String Object. Split is a function, that’s right
split() is a method of String. The str you print out is obviously an array
Your str is not a string type number, and the split method does not exist in arrays.
It should be a method under a certain class, a method under string. Can’t be taken out separately, use it directly
Convert arr to string, then use this method
You should first convert arr to string and then use split