title: What is the simplest way to shorten a long if/else statement?
body: <p><b>Fully functional (simplified) example below.</b></p>
  
  <p>Let's say I have a list of 10 possible abbreviations that could be converted to a full name.<br>It's not large enough that I'd want to do a lookup in a database.<br> What is the simplest if-else solution?</p>
  
  <p>Here's my imaginary solution: Logically, it would makes sense to compare two arrays such as:<br>
  <code>var bar = [foo == sf, foo == ny, foo == la] ? [San Francisco, New York, Los Angeles] : "";</code></p>
  
  <p>Otherwise, I have a functioning solution below. Can I do any better than that?</p>
  
  <p>EDIT: The ideal solution would be one line of code. I don't want to use a switch statement as it's not much more efficient to write than an if/else.</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>bar = "LA";
  sf = "SF";
  ny = "NY";
  la = "LA";
  {
  if (bar == sf) {
  foo = "San Francisco";
  } else if (bar == ny) {
  foo = "New York";
  } else if (bar == la) {
  foo = "Los Angeles";
  }
  document.getElementById("test").innerHTML = foo;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="test"&gt;Result&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>