title: removing an item from an array in Vuex
body: <p>I am just starting using Vuex but am having a problem (and this could be some clueless syntax error on my part). I have a user with liked_items and have a network call that is to unlike an item. </p>
  
  <pre><code>mutations: {
  SET_TOGGLE_LIKED: (state, { global_id }) =&gt; {
    alert('here is global_id: ' + global_id)
   state.user.liked_items.find((obj,i) =&gt; {
     if(obj.global_id === global_id){ // no global_id
        console.log('that exists at i: ' + i + ' with length: ' + state.user.liked_items.length)
        state.user.liked_items.splice(i, 1)
        console.log('that exists at i: ' + state.user.liked_items.length)
     }else{
       console.log('that doesnot exist!')
     }
   })
  }
  </code></pre>
  
  <p>The problem I'm having is that after removing an item from the liked_items list, that seems to get recalled and I get an error that global_id does not exist on undefined. </p>
  
  <p>I am able to fix by having: </p>
  
  <pre><code> state.user.liked_items.find((obj,i) =&gt; {
     if(obj){
       if(obj.global_id === global_id){
  </code></pre>
  
  <p>but why do I need to check for the existence of <code>obj</code> here?</p>