代码改变世界

es6的解构赋值

2017-09-15 10:54  改吧  阅读(976)  评论(0编辑  收藏  举报
let {name,age}={name:'asa',age:134};

console.log(name)==>'asa'

console.log(age)==>134

 

 

let [x,y]=[1,2,3]

console.log(x)===>1

console.log(y)===>2