react 字符串转数组

可以使用 JavaScript split() 方法将字符串分割为数组。例如:

const str = "a,b,c,d";
const arr = str.split(",");
console.log(arr);
// Output: [ "a", "b", "c", "d" ]
  •