JavaScript : - Break Statement


Hello Friends..!!

This is JavaScript Practical: - Break Statement.
Script written in small letter because JavaScript Case Sensitive.

Script:-
<html>
<head>
<title>break</title>
</head>
<body>
<script type="text/javascript">
// this is a break statement.
var x=parseInt(prompt("enter no."));
document.write("start");
while (x <= 50)
{
if (x == 40)
{
break;
}
x = x+1;
document.write(x + "<br />");
}
document.write("end");
</script>
</body>
</html>
Save the File .html

Output:-


If you have any doubts mention on the Comment Box.

Please follow my Blog, Share and Comment.

Comments

Popular posts from this blog

What is Website