title: Is it bad practice to have a switch within forEach with Javascript?
body: <p>Is it bad practice to have a switch within forEach using Javascript?</p>
  
  <pre><code>book.forEach(function (getBook, i) {
    switch (getBook) {
    case path:
      string = 'some html';
      break;
    };
  });
  </code></pre>
  
  <p>My understanding is that this would create a switch for every instance of getBook. Let's say there are 100 of those. Then I have 100 separate switches. Is that bad?</p>
  
  <p>Most importantly, does anyone have a better way to do this? It seems like it would be better to only have one switch as opposed to a whole bunch.</p>