ES6

作者: younglaker | 来源:发表于2019-07-31 18:16 被阅读0次

    const {}

    state ={
      girls:1,
      guys:2,
      women:3,
      women:4
    }
    const {girls, guys, women, men} = state;
    

    Is the same as

    const girls = state.girls;
    const guys = state.guys;
    const women = state.women;
    const men = state.men;
    

    Spread syntax

    展开语法(Spread syntax),扩展运算符是三个点(...)。用于取出参数对象的所有可遍历属性,然后拷贝到当前对象之中
    https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax

    https://www.cnblogs.com/it-Ren/p/10637904.html

    image.png

    相关文章

      网友评论

          本文标题:ES6

          本文链接:https://www.haomeiwen.com/subject/zumtdctx.html