Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
javascript [2020/10/05 03:08] paul [call function] |
javascript [2020/10/05 03:09] (current) paul [Object Spread Operator] |
||
---|---|---|---|
Line 338: | Line 338: | ||
===== Object Spread Operator ===== | ===== Object Spread Operator ===== | ||
- | The Object Spread Operator is '' | + | The Object Spread Operator is '' |
+ | |||
+ | I was really confused about it when I saw it used to spread out properties of an object that was returned by a function [[https:// | ||
+ | |||
+ | <code javascript> | ||
+ | computed: { | ||
+ | localComputed () { /* ... */ }, | ||
+ | // mix this into the outer object with the object spread operator | ||
+ | ...mapState({ | ||
+ | // ... | ||
+ | }) | ||
+ | } | ||
+ | </ | ||