title: Javascript for loop check condition
body: <p>I want to create a function that will generate a random number between 0 to 9 which is not in the array.</p>
  
  <p>My code so far: </p>
  
  <pre><code> var myArr = [0,2,3,4];
  
    console.log("Arr: " + myArr);
  
  
    function newNum(){
       console.log("test");
  
       for (var i = 0; i &lt; 10; i++) {
         var n = myArr.includes(i)
         // I want to return n if it's not present in the array
       }
       return n;
    }
  
  newNum()
  </code></pre>
  
  <p>I want to return only 1 number. How do I do this?</p>
  
  <p>Thanks.</p>