Javascript

Sentencias iterativas y selectivas

User Rating:  / 0
PoorBest 

Los temas que cubrimos en este tutorial son:

Sentencias If - Ternary operator

Sentencias For

Sentencias While

Trabajando con arreglos.

{codecitation} <!DOCTYPE html>

<html>

    <head>

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

        <title>untitled</title>

    </head>

    <body>

        <script type="text/javascript" charset="utf-8">

// var myArray = [];

// myArray[0] = "Hello world! ";

// myArray[1] = "How are you?";

// for (var i = 0; i<= myArray.length; i++){

// document.write(myArray[i]);

// }

// var i = 0;

// while (i<=10){

// document.write(i);

// i++;

// }

         // for ( var i = 0; i <= 10; i++){

         // if (i === 4){

         // break;

         // }

         // document.write(i);

         // }

// var x = 4;

         // x = (x === 5) ? 10 : 5;

         // document.write(x);

// if (x <= 5){

// document.write("sí es menor o igual");

// }else{

// document.write("no es menor");

// }

        </script>

    </body>

</html>

{/codecitation}

Category: Javascript