let a = "测试,中文,标签,哈哈," a = a.replace(/,/g, ",").split(",").filter(item=>item) console.log(a) console.log(a.length)