在对象中使用es6的解构赋值
const obj = { name : 'zs',obj:18}
变更变量名
const {name : xx} = obj
console.log(xx) // 'zs'
在对象中使用es6的解构赋值
const obj = { name : 'zs',obj:18}
变更变量名
const {name : xx} = obj
console.log(xx) // 'zs'
本文标题:ES6 解构赋值
本文链接:https://www.haomeiwen.com/subject/zucjlktx.html
网友评论