title: Reverse array with math.floor function in javascript
body: <p>Why does my function not print the reversed array in my console?</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>var numbers = [1, 2, 3, 4, 5, 6, 7];
  
  function swap(array) {
    for (var i = 0; i &lt; Math.floor(array / 2); i++) {
      var temp = array[i];
      array[i] = array[array.length - 1 - i];
      array[array.length - 1 - i] = temp;
    }
    return array;
  }
  console.log(swap(numbers));</code></pre>
  </div>
  </div>
  </p>