Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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 ''...'' and it allows you to spread concatenate lists in a one line. [[https://github.com/tc39/proposal-object-rest-spread|Link]].+The Object Spread Operator is ''...'' and it allows you to spread concatenate lists in a one line. [[https://github.com/tc39/proposal-object-rest-spread|Link]].  
 + 
 +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://vuex.vuejs.org/guide/state.html#object-spread-operator|here]]. 
 + 
 +<code javascript> 
 +computed: { 
 +  localComputed () { /* ... */ }, 
 +  // mix this into the outer object with the object spread operator 
 +  ...mapState({ 
 +    // ... 
 +  }) 
 +
 +</code>
  
  • javascript.txt
  • Last modified: 2020/10/05 03:09
  • by paul