const obj = {
a:1,
b:2,
c:3,
d:4,
e:5
}
const a = obj.a;
const b = obj.b;
const f = obj.a + obj.d;
这样太繁琐
用ES6的解构赋值来取值
const {a,b,c,d,e}=obj
const f = a+d
标签:ES6,const,解构,新型,obj,取值 From: https://www.cnblogs.com/123abcde/p/17007642.html
const obj = {
a:1,
b:2,
c:3,
d:4,
e:5
}
const a = obj.a;
const b = obj.b;
const f = obj.a + obj.d;
这样太繁琐
用ES6的解构赋值来取值
const {a,b,c,d,e}=obj
const f = a+d
标签:ES6,const,解构,新型,obj,取值 From: https://www.cnblogs.com/123abcde/p/17007642.html