Source of the above display is here

<script language='JavaScript' type='text/JavaScript'>
<!--
var i=0;
while (i <= 5){
for(j=0;j<=i;j++){
document.write ("*");
}
document.write ("<br>");
i++;
}
//-->
</script>
Return to tutorial on While loop