continue ceases to execute the current iteration of the loop and skips ahead to the next iteration. : continue « Statement « Flash / Flex / ActionScript






continue ceases to execute the current iteration of the loop and skips ahead to the next iteration.

 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var needle:int = 3;
        var haystack: Array = new Array(1,2,3,4,5,6);
        for (var i:int = 0; i < haystack.length; i++) {
           if (!(hay == haystack[i])) { 
             continue; 
           }
           trace("I found the needle!");
           break;
        }
    }
  }
}

        








Related examples in the same category

1.Use continue to avoid dividing by 0