JS Arrays

 
<!DOCTYPE html>
<html>
<head>
  <title>JavaScript</title>
  <script>
    var ary = [10, 20, 30, 40, 50]
    document.write("<ul>");
    for (a = 0; a <= 4; a++) {
        document.write("<li>" + ary[a] + "</li>");
    }
    document.write("</ul>");
  </script>
</head>
<body>
</body>
</html>
 
<!DOCTYPE html>
<html>
<head>
  <title>JavaScript</title>
  <script>
    var ary = [10, 20, 30, 40, 50]
    var sum = 0;
    document.write("<ul>");
    for (a = 0; a <= 4; a++) {
        document.write("<li>" + ary[a] + "</li>");
        sum = sum + ary[a];
    }
    document.write("</ul>");
    document.write("Total Sum:" + sum);
  </script>
</head>
<body>
</body>
</html>
 
<!DOCTYPE html>
<html>
<head>
  <title>JavaScript</title>
  <script>
    var ary = [10, "Harry","Sarah", true, null];
    document.write("<ul>");
    for (a = 0; a < 5; a++) {
        document.write("<li>" + ary[a] + "</li>");
    }
    document.write("</ul>");
  </script>
</head>
<body>
</body>
</html>