js数组转字符串
- const str = arr.join(‘’)
- const str = arr.toString().replace(/,/g,‘’)
- const str = arr.reduce((acc,cur) => acc+cur,‘’)
- 循环迭代拼接
for(let i=0;i<arr.length;i++){
str+=arr[i]
}
js字符串转数组
- let arr = str.split(“”)
- let arr = Array.from(str)
- let arr = […str]