title: In a nested-loop JS function, does 'return' exit the loop, or the whole function?
body: <p>I have a piece of JavaScript I can't get to work (Euler Project, problem 3), and I have nested loops as part of the solution. If a condition is met, I want to exit a child loop, and continue with the parent loop. Should I be using return or break to accomplish this?</p>
  
  <p>I've read the answers here: <a href="https://stackoverflow.com/questions/183161/best-way-to-break-from-nested-loops-in-javascript">Best way to break from nested loops in Javascript?</a> but am still confused, especially on the answer that includes an anonymous function as part of the solution.</p>