Friday, August 16, 2013

JavaScript continue statement

<html>
<body>
<script type="text/javascript">
var i=0;
for (i=0;i<=10;i++)
{
if (i==3)
  {
  continue;
  }
document.write("The number is " + i);
document.write("<br />");
}
</script>

<p>Explanation: The loop will break the current loop and continue with the next value when i=3.</p>

</body>
</html>

Result


No comments: