Estructura do...while
- Mientras se cumple la condición, ejecute este código
- Do (o ejecutar) este código mientras se cumple la condición
<!doctype html> <html> <head> <title>Do While</title> </head> <body> <script type="text/javascript"> var x = 0; do{ document.write("El num es " + x + "<br />"); x++; } while (x < 3); </script> </body> </html>Este código mostrará tres líneas:
<!doctype html> <html> <head> <title>Do While</title> </head> <body> <script type="text/javascript"> var x = 4; do{ document.write("El num es " + x + "<br />"); x++; } while (x < 3); </script> </body> </html>Observe como si se ejecuta el valor de la variable, sin embargo ya no se continua con el bucle, debido a que no se cumple la condición.
Si te hemos ayudado : )
Te agradeceríamos que apoyaras este proyecto
en:

0 comentarios:
Publicar un comentario