Why is split in JavaScript not a function?
为情所困
为情所困 2017-06-15 09:21:37
0
9
941

console.log(str);

为情所困
为情所困

reply all(9)
世界只因有你

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

Ty80

You should first convert arr to string and then use split

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template