const list = [{
type: "string",
value: "字符串一"
}, {
type: "string",
value: "字符串二"
}, {
type: "string",
value: "字符串三"
}]
const newList = []
list.forEach(arg => {
newList.push(arg.value)
})
console.log(newList);
const str = newList.join(",")
console.log(str) // 字符串一,字符串二,字符串三
js遍历后的数据,重新组成数组或者字符串
最新推荐文章于 2023-01-31 14:43:43 发布