请问js怎么去除name中, 头和尾的[]
var name ="[2,3,4,5,6,7,8]";
回答
JSON.parse(name).join(',')
var name ="[2,3,4,5,6,7,8]";
name.replace(/^[|]$/g,'')
以上是 请问js怎么去除name中, 头和尾的[] 的全部内容, 来源链接: utcz.com/p/38441.html
var name ="[2,3,4,5,6,7,8]";
JSON.parse(name).join(',')
var name ="[2,3,4,5,6,7,8]";
name.replace(/^[|]$/g,'')
以上是 请问js怎么去除name中, 头和尾的[] 的全部内容, 来源链接: utcz.com/p/38441.html