数组的解构

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

数组的合并

  1. const arr1 = ['a', 'b'];
  2. const arr2 = ['c'];
  3. const arr3 = ['d', 'e'];
  4. [...arr1, ...arr2, ...arr3]
  5. // [ 'a', 'b', 'c', 'd', 'e' ]

字符串转数组

  1. [...'hello']
  2. // [ "h", "e", "l", "l", "o" ]