title: Inline if statement and return
body: <p>I have a function that I'm trying to optimize at the moment but I'm running into some issues.</p>
  
  <p>The function will be called a lot of times, so I'm trying to make it so that the returned value is quickly determined and that the next call begins. </p>
  
  <p>(By quickly determined I mean not having a single <code>return</code> statement at the end of the function.)</p>
  
  <p>This is the simplified code : </p>
  
  <pre><code>function myFunction(letr) {
      if (letr === " ") return var letc = " ";
      // ... other checks on letr that will return other values for letc
  }
  </code></pre>
  
  <p>The issue is that the 2nd line doesn't seem to be valid JavaScript.</p>
  
  <p>How can this be written the right way + optimized ?</p>
  
  <p>Thank you in advance !</p>