http://sinhviencntt.net/lenh-break-continue-va-label-trong-javascript/

http://sinhviencntt.net/lenh-break-continue-va-label-trong-javascript/

by sinhviencntt

HTML

<!DOCTYPE html>
<html>
<body>
 
<h1>Lệnh continue trong JavaScript SinhVienCNTT</h1>
 
<script>
var i = 1;
diemA:
while (true) {
    document.write("</br></br></br>Chọn Ngẫu Nhiên Lần: ");
    document.write(i + ": </br>");
    i ++;
     
    var tong = 0;
    while (true) {
      var x = Math.floor((Math.random() * 100) + 1);
      document.write(x + " ;  ")
      tong += x;
      if (tong > 1000) {
        document.write("</br>Tổng " + tong)
          break;
      }
      if (x == 100) {
          break diemA;
      }
    }
}
 
</script>
 
</body>
</html>