0

I'm try to break out of a double for loop, if a condition is true, my code doesnt work correctly. Anyone know how to do this?

for (var i = 0; i <eightPoints.length; i++)
       {
            for (var j = 0; j <eightPoints.length; j++)
            {
              ....
              ....
                if (bool == true)
                {

                  calculateAndDisplayRoute(0);
                  //break;   ??

                }



            }
          //break;   ??

       }
Darren
  • 23
  • 4

1 Answers1

0

Set i = eightPoints.length before break. I don't have any other idea to get out of two for-loops. Definitely break is not the solution as it can break out of only one loop.

Len
  • 142
  • 8