数组长度不是应该是0吗?
参见: https://developer.mozilla.org...
Description
When found, separator is removed from the string and the substrings are returned in an array. If separator is not found or is omitted, the array contains one element consisting of the entire string.
如果没有找到分隔符,则会返回一个只有一个元素的数组,这个数组包含了原来的字符串,就算是空字符串,也算是一个元素!
看看官方的函数说明文档,就会很清楚了
13 回答13k 阅读
7 回答2.2k 阅读
3 回答1.4k 阅读✓ 已解决
6 回答1.3k 阅读✓ 已解决
2 回答1.4k 阅读✓ 已解决
3 回答1.4k 阅读✓ 已解决
6 回答1.2k 阅读
这个问题你分两步分别打个console不就知道了?干嘛一定得发上来问?