title: add up all value's of a property in an array Vuejs
body: <p>I am working on a small app and I have a array with objects and within the objects 2 property's, one called 'label' and one 'value'. What I would like is to add up all values of the property 'value', So that I have one total value.</p>
  
  <p>Vue/JS</p>
  
  <pre><code>data() {
  
  totalRequest: 0,
  
     donutData: [
          { label: 'Openstaande verzoeken', value: 20 },
          { label: 'Geaccepteerde verzoeken', value: 25 },
          { label: 'Afgewezen verzoeken', value: 10 }
      ],
  
  },
  
  created() {
          this.totalRequest = //here goes the function to add up all value's of the property 'value' (total value should be 55)
  }
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>total value {{ totalRequest }}
  </code></pre>
  
  <p>So in this example I have 3 objects with a total value of 55 (all 3 property 'value'). How can I achieve this? Thanks in advance.</p>
  
  <p><strong>Answer by dashton, reproduced for vue</strong></p>
  
  <pre><code>created() {
          this.totalRequest = this.donutData.reduce((acc, item) =&gt; acc + item.value, 0);
  }
  </code></pre>