Home > front end >  An interview question about three operators
An interview question about three operators

Time:03-23


Why hasn't the {x: 1} to b on the prototype of heavyweight solutions,
Let {... B}=an empty object, said what mean

CodePudding user response:

It's called extension (expand) operator...
If you want to such direct b.x=1; You need to let b=Object. The create ({x: 1}). __proto__;

Extensions (expand) operator, the equivalent of the internal data, also can be used in array, generally application scenarios in shallow copy of data, or level of 1 deep copy; Or mixed with data, or to truncate the reference relationship, such as

More look for es6 new features

CodePudding user response:

Es6 new features for new browser, only to learn: there are so many things
  • Related