Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
javascript [2020/09/30 03:41]
127.0.0.1 external edit
javascript [2020/10/05 03:09]
paul [Object Spread Operator]
Line 336: Line 336:
 to explicitly pass a ''this'' object as the first parameter. to explicitly pass a ''this'' object as the first parameter.
  
 +===== 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]]. 
 +
 +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