title: JS if-statement between a split string
body: <p>How can I place if statements between a split string? Obviously I can make it like that:</p>
  
  <pre><code>if(lang == 'eng'){
    var a_string = 'hello';
  }else if(lang == 'ger'){
    var a_string = 'hallo';
  }
  </code></pre>
  
  <p>but that's too long for some situations. What came in my mind was the following:</p>
  
  <pre><code>var lang = (e.g. 'ger' or 'eng');
  
  var a_string = 'h' + if(lang == 'eng'){'e'}else if(lang == 'ger'){'a'} + 'llo';
  </code></pre>
  
  <p>Is there a way to write if statements between a split string?</p>