ES6

2019-07-31  本文已影响0人  younglaker

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
上一篇下一篇

猜你喜欢

热点阅读