title: How to assign a variable in a switch statement in typescript?
body: <p>I want to use a switch statement to assign a new variable some value.</p>
  <p>Example:</p>
  <pre><code>let name: string
  
  switch(index) {
      case 0:
         name = &quot;cat&quot;
      case 1:
         name = &quot;dog&quot;
      ....
  }
  </code></pre>
  <p>But it is telling me <code>'name' is declared but its value is never read.</code> Not sure how to fix this...anyone know the proper way to go about this?</p>