首页 > 试题广场 >

分割字符串的方法是(),连接数组元素的方法是()。

[填空题]

分割字符串的方法名是1连接数组元素的方法名是2

刚才一个题,css样式后面不加分号,这个方法又不加括号,我算是摸清牛客的出题套路了!!!
发表于 2017-08-19 21:29:28 回复(1)
var arr = new Array(3)
arr[0] = "George"
arr[1] = "John"
arr[2] = "Thomas"

document.write(arr.join())
>>George,John,Thomas 
var arr = new Array(3)
arr[0] = "George"
arr[1] = "John"
arr[2] = "Thomas"

var arr2 = new Array(3)
arr2[0] = "James"
arr2[1] = "Adrew"
arr2[2] = "Martin"

document.write(arr.concat(arr2))
>>George,John,Thomas,James,Adrew,Martin 

连接数组concat,连接数组元素join,只能这么理解了┑( ̄Д  ̄)┍

发表于 2017-08-19 16:38:45 回复(0)
split()
join()
不应该带()吗???
发表于 2017-08-19 11:36:35 回复(0)
分割字符串:split
连接数组元素:join
连接数组:concat

发表于 2017-12-06 15:24:54 回复(0)
分割字符串是 String.prototype.split 链接数组是 Array.prototype.concat
发表于 2017-09-30 11:51:17 回复(0)
这套题考的不是前端吧,完全和前端不怎么沾边。。。
发表于 2019-01-23 21:57:07 回复(0)
concat
发表于 2018-08-01 15:42:31 回复(0)
为什么有这么多崩蛋的题
发表于 2018-07-27 09:38:43 回复(0)
split slice
发表于 2018-02-27 10:52:05 回复(0)
split join
发表于 2017-11-07 00:33:10 回复(0)
分割字符串split 连接数组 join
发表于 2017-10-08 10:35:52 回复(0)
这个答案判断方式有点让人头疼

发表于 2017-08-30 11:13:16 回复(0)
(1) split
(2) join
语文不好实在很抱歉
发表于 2017-08-18 23:47:11 回复(2)
*w头像 *w
分割字符串split 聚合字符串join
发表于 2017-08-14 08:58:36 回复(0)