1

Temat: Z lekcji (1)

switch
---------------------------------------------

<script>
  var a = 7;
  switch (a)
  {
    case 1: document.write("pon"); break;
    case 2: document.write("wtorek"); break;
    case 3: document.write("sroda"); break;
    case 4: document.write("czwartek"); break;
    case 5: document.write("piatek"); break;
    case 6: document.write("sobota"); break;
    case 7: document.write("niedziela"); break;
  }
</script>

while + tabliczka mnożenia
---------------------------------------------

<script>
  var x = 1;
  while (x <= 9)
  {
    var y = 1;
    while (y <= 9)
    {
      document.write(x + " x " + y +" = " + (x*y));
      y++;
      document.write("<br>");
    }
    x++;
    document.write("<hr>");
  }
</script>