ES6解构赋值

161 阅读1分钟
1.1 ES6解构赋值之对象解构
let obj = {
  a: '1',
  b: '2'
}
let { a, b } = obj
console.log(a, b) // 1 2

常用于对接口返回的数据,进行处理。