title: map function to return 1 boolean value, instead of an array of boolean values
body: <p>Say you have an array like this:</p>
  <pre><code>arrayExample = [1, 2, 3, 4, 5, 6, 7]
  </code></pre>
  <p>I want to use the map function to iterate through arrayExample and return <strong>true</strong> if all the numbers are less than 8, <strong>false</strong> if they are not. However, when I do this I get an array of trues (like: [true, true, true... etc])</p>
  <p>Would I be able to return just 1 value?</p>
  <p>Here is my code so far:</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 testBoolean = true;
  var array = [1,2,3,4,5,6,7];
  
  testBoolean = array.map(m =&gt; { 
      //if a number in the array is &gt;=8, changes the testBoolean to false and return false only
      if(m &gt;= 8) 
      { 
          return false;
      }
      //VS code said I had to have a return here, I believe its because I need to have in case m &lt; 8 (edited after reading a comment)
      return true;
   })
   
   //prints an array [true,true,true,true,true,true,true]
  document.write(testBoolean); </code></pre>
  </div>
  </div>
  </p>
  <p>I'm a bit new to &quot;map&quot; but I believe it does this since it returns a value for every element, just confused on how to make it so it returns 1 <strong>true</strong> or <strong>false</strong>.</p>