title: finding ratio of an array of intergers between 2 integers l and r. in javascript
body: <p>You are given an array of integers a and two integers l and r. You task is to calculate a boolean array b, where b[i] = true if there exists an integer x, such that a[i] = (i + 1) * x and l ≤ x ≤ r. Otherwise, b[i] should be set to false.</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 boundedRatio(a, l, r) {
    let b = []
    for (let i = l; i &lt;= r; i++) {
      //  
      for (let j = 0; j &lt; a.length; j++) {
        let result = (j + 1) * i
  
        if ((j + 1) * i === a[j] &amp;&amp; l &lt;= i &lt;= r) {
          b.push(true)
        } else {
          b.push(false)
        }
  
      }
    }
  
    return b
  
    boundedRatio([8, 5, 6, 16, 5], 1, 3)
    // [false, false, true, false, true]</code></pre>
  </div>
  </div>
  </p>