title: What's the job of "return" right underneath the if clause in this exact function? also pls explain in words how this function works ty
body: <p>Write a function that returns the smallest number that’s greater or equal to 0. Especially that return right underneath if (num &lt; 0). What's that return's job here?</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 minNonNegative(numArray) {
    let min = Infinity;
  
    numArray.forEach(function(num) {
      if (num &lt; 0) {
        return;
      } else if (num &lt; min) {
        min = num
      }
    });
    return min;
  }
  
  console.log(minNonNegative([-3,2,5,-9]))</code></pre>
  </div>
  </div>
  </p>