break in javascript

     The break statement totally break the loop, in the following example write a for loop for execute 10 times but when the i value is come 3 the loop will totally terminated.

Example

for (i = 0; i < 10; i++)
{

  if (i == 3)
  {

    break; //Terminate the for loop

  }

  alert(i);

}



Example Program:- (Editor)


Editor is Loading...

Advertisement



Tags:
break statement in allinworld99,break in allinworld99

Nhận xét

Bài đăng phổ biến từ blog này

How to set the SDK, NDK and JDK path to android studio?

if statement

Select all values from list box in a single click using javascript