title: Slice vs filter in redux delete action
body: <p>From <code>Redux</code> documentation, I know, that we never should mutate state and that's why we should use <code>concat</code> and <code>slice</code> methods, so I ended up with following reducer(most of actions removed for simplification):</p>
  
  <pre><code>export default function blocks(state = [], action) {  
      switch (action.type) {
          case DELETE_BLOCK:
            var index = state.findIndex(e =&gt; e.id === action.blockId);
            return [...state.slice(0, index), ...state.slice(index + 1)];
          default:
            return state;
  }
  </code></pre>
  
  <p>In my case I don't have index of element I want to delete, so can I use <code>filter</code>? Like this:</p>
  
  <pre><code>export default function blocks(state = [], action) {  
      switch (action.type) {
          case DELETE_BLOCK:
            return state.filter(e =&gt; e.id !== action.blockId);
          default:
            return state;
  }
  </code></pre>