title: Why i cant use for this way?
body: <p>The plan is:</p>
  <ol>
  <li><p>sort 'arr' from less to greater.</p>
  </li>
  <li><p>push values in range of both number from arr, inclusively.</p>
  </li>
  <li><p>find smallest common number which dividible on each value from 'arrForAll' without reminder.</p>
  </li>
  <li><p>Assign to 'i' first value from 'arrForAll'.</p>
  </li>
  <li><p>Output 'while' condition isn't false. Condition is: 'i' don't divide on each value from 'arrForAll' without reminder.</p>
  </li>
  </ol>
  <p>I tried this:</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>function smallestCommons(arr) {
    let sortedArray = arr.sort();
    let arrForAll = []
    for (let i = sortedArray[0]; i &lt; sortedArray[1] + 1; i++) {
      arrForAll.push(i)
    }
    for (let i = sortedArray[1]; arrForAll.every(x =&gt; i % x !== 0); i += i) {
      console.log(i)
    }
    return arr;
  }
  console.log(smallestCommons([1, 5]));</code></pre>
  </div>
  </div>
  </p>
  <p>But console output nothing.
  What's wrong in code?</p>