The three dots of the spread operator in ES6...

 扩展运算符(...)用于取出参数对象或者数组中的所有可遍历属性,拷贝到当前对象之中

Case:


          let a =  [1,2,3] 
          let b =  [4,5,6]
          let c = []
          let c = [...a,...b]   //log打印c =  [1,2,3,4,5,6]
          let c = [...a,...b,7,8]  //c = [1,2,3,4,5,6,7,8]

 

Guess you like

Origin blog.csdn.net/weixin_57607714/article/details/123008018