[js][js array]快速把所有陣列元素轉為字串

  • 581
  • 0

[...arr.join("")]

 

...

關鍵字:destructuring assignment

ex:

let arr=[1,2,3];

arr = [...arr.join("")];

console.log(arr); //["1","2","3"]