title: Checking whether array has a number bigger than specified
body: <p>I want to write a function that takes array as an argument and returns how many numbers can be divided by 12. However, if array has a number higher than 111 then it should return 0;
  I wrote 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 isDivisble(array) {
    let numberOfNum = 0;
    for(let i=0; i &lt; array.length; i++) {
      if(array[i] % 12 == 0 &amp;&amp; array[i] &lt; 111) {
        numberOfNum = numberOfNum + 1 ;
      } else {
        numberofNum = 0;
      }
    }
    return console.log(numberOfNum);
  }
  
  let test = [12, 24, 36, 44, 55, 255];
  
  
  isDivisble(test)</code></pre>
  </div>
  </div>
  </p>
  <p>I realized that this code checks individually whether the current number is divisible and not higher than 111 and not globally whether the array has a number higher than 111, but I dont understand how to make a general array check.
  Is writing for loop with if statement to check and then another for loop inside if statement makes it a little bit spaghetti?</p>