title: nesting 'switch' cases in javascript: any speed advantage?
body: <p>newbie question here: I have a 'switch' containing numerous strings. Is there a speed advantage in splitting it alphabetically, like this?</p>
  
  <pre><code>switch(myString.substring(0,1)){
  case "a" : switch(myString){
             case "a string beginning with a"       : runCode(); break;
             case "another string beginning with a" : runCode(); break;
             } break;
  case "b" : switch(myString){
             case "by golly another string"         : runCode(); break;
             case "blimey - hundreds of strings"    : runCode(); break;
             //... etc
  </code></pre>
  
  <p>Or does a scripted language read every line anyway, just to find the closed brackets?</p>