title: Returning a value from switch statement
body: <p>I'm new to web development (JS) and I know there are many topics matching the title of mine, but no similar questions were answered, or maybe because I'm newbie, couldn't find.</p>
  
  <p>In the code below I wanted my function and switch statements, to retrieve values from the arrays (bills) and in order to calculate new value, which to be assigned into a new non-existing place into the array <code>tips</code>. As a final result I want the function to return <code>tips</code> array with the value, depending on the case.</p>
  
  <p>I know another way for solving this, anyway I was wondering whats wrong here, because that idea for <code>solving</code> it first came to my mind, and I thought it would work.</p>
  
  <p>Here is my code: </p>
  
  <pre><code>var tips = [];
  var bills = [124, 48, 264];
  
  function tipCalc(bills, tips){
   switch(bills){
      case bills &lt; 50:
        tips[0] = bills[1] * 0.2;
        break;
  
      case bills &gt; 50:
        tips[1] = bills[0] * 0.5;
        break;
  
      default:
        console.log('no tips left.');
    }
    return tips;
  }
  
  tips = tipCalc(bills[0]);
  console.log(tips);
  
  enter code here
  </code></pre>