JSFiddle - React, Tailwind, and code Playground
JavaScript
var sum=0;
for (i=0;i<10;i++)
{
if (i==3)
{
break;
}
sum=sum+i;
}
alert(sum);
//another code goes here will continues execution after break the execution of loop.
var sum=0;
for (i=0;i<10;i++)
{
if (i==3)
{
break;
}
sum=sum+i;
}
alert(sum);
//another code goes here will continues execution after break the execution of loop.