去重:
let names =["1","2","3","2","3","2","3"]
let categories = [...new Set(names)]; // 或者 categories = Array.from(new Set(names))
//查找重复数据的长度
categories.forEach(value => {
dataLenth.push(names.join('').split(value).length - 1)
})
去重:
let names =["1","2","3","2","3","2","3"]
let categories = [...new Set(names)]; // 或者 categories = Array.from(new Set(names))
//查找重复数据的长度
categories.forEach(value => {
dataLenth.push(names.join('').split(value).length - 1)
})