title: prevent a runtime error when filtering an array that might not exist at certainty point?
body: <p>I have this reducer state chunk, that is causing a runtime error
  (TypeError: (intermediate value)(intermediate value)(intermediate value) is not iterable)
  since, at a certain point, the object might not be available in the state, any idea how to prevent the run time from stumbling on the part of chunk that is not available (childGroup) at the current moment? and run it only when certain criteria are met I tried adding ?? [] before the filter but typescript errored out cannot call filter on never. the issue happens when I want to delete the parent group only when there is no child group! , if there is a child group works like charm.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// REMOVE  GROUP
      case types.DELETE__GROUP:
  
        return {
          ...state,
          parentGroup: {
            ...state.parentGroup,
            [action.payload.parentId!]: state.parentGrou[action.payload.parentId!]?.filter((el) =&gt; el.id !== action.payload.id),
          },
          childGroup: {
            ...state.childGroup,
            [action.payload.parentId!]: [...state.childGroup[action.payload.parentId!]?.filter((el) =&gt; el.parentId !== action.payload.id)],
          },
        };</code></pre>
  </div>
  </div>
  </p>