Tuesday, 19 February 2013

Break the for loop

Write a java script to break the for loop


<!DOCTYPE html>
<html>
<body>
<script>
names=["Geetha","Siri","Rani","Lakshmi"];
for (var i=0;i<names.length;i++)
{
document.write(names[i] + "<br>");
}
</script>
</body>
</html>


Output:


Geetha
Siri
Rani
Lakshmi