Reputation: 89
Obj.a = xxx
Obj.b = yyy
Obj.c = zzz
I want to just typing to
With(obj){
a = xxx
b = yyy
c = zzz
}
With syntex is deprecate in es6
Upvotes: 0
Views: 42
Reputation: 22
or you can use spread operator.
const obj = {...{}, a: "xxx", b: "yyy", c: "zzz"}
Upvotes: 0
Reputation: 664444
You can use Object.assign
:
Object.assign(obj, {
a: xxx,
b: yyy,
c: zzz,
})
Upvotes: 3