title: JavaScript Function Exercise Day Of The Week
body: <p>I need to make a function that takes an integer from <code>1</code> to <code>7</code>.</p>
  <p>If the number is less than <code>1</code> or greater than <code>7</code>, the function should return <code>null</code>. Then each number should represent the day of the week.</p>
  <p>So if I try something like function return <code>Day(1)</code>, it should give me an output of <code>'Sunday'</code>,</p>
  <pre class="lang-js prettyprint-override"><code>&gt; Day(2)
  ⋖ 'Monday'
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>&gt; Day(3)
  ⋖ 'Tuesday'
  </code></pre>
  <p>And so on...</p>
  <p>So this is my approach, yet it didn't work and I think my syntax is a little bit sketchy, so I would like to get the correct approach :)</p>
  <pre class="lang-js prettyprint-override"><code>const weekDAY = new Array(7);
  weekDAY[1] = 'Sunday' ;
  weekDAY[2] = 'Monday';
  weekDAY[3] = 'Tuesday';
  weekDAY[4] = 'Wednesday';
  weekDAY[5] = 'Thursday';
  weekDAY[6] = 'Friday';
  weekDAY[7] = 'Saturday';
  
  function returnDay(x) {
    return (x &lt; 1) || (x &gt; 7) ? null :
    } else {
      let thisDay = weekDAY[x]
      return thisDay;
    }
  }
  </code></pre>