You are on page 1of 2

Learning Sheet ICT 10

JavaScript Loops

Directions: Perform the codes below:

1.

<!DOCTYPE html>
<html>
<body>
<script>
var i=11;
while (i<=15)
{
document.write(i + "<br/>");
i++;
}
</script>
</body>
</html>

2.
3. <!DOCTYPE html>
4. <html>
5. <body>
6.
7. <h2>JavaScript For Loop</h2>
8.
9. <p id="demo"></p>
10.
11. <script>
12. const cars = ["BMW", "Volvo", "Saab", "Ford"];
13. let i, len, text;
14. for (i = 0, len = cars.length, text = ""; i < len; i++) {
15. text += cars[i] + "<br>";
16. }
17. document.getElementById("demo").innerHTML = text;
18. </script>
19.
20. </body>
21. </html>
3.
<!DOCTYPE html>
<html>
<body>

<h2>JavaScript For Loop</h2>

<p id="demo"></p>

<script>
const cars = ["BMW", "Volvo", "Saab", "Ford"];
let i = 2;
let len = cars.length;
let text = "";

for (; i < len; i++) {


text += cars[i] + "<br>";
}

document.getElementById("demo").innerHTML = text;
</script>

</body>

Prepared by:

Robert S. Pugayan Jr.


TLE Subject Teacher

Noted:

_______________________

Activity 1: Rubrics
Point Descripti
s on
10 The student successfully executes the program without guidance or
supervision.
The student successfully executes the program with very little
9
supervision and guidance.
The student successfully executes the program with moderate supervision
8
and guidance.
The student was not able to execute the program but shows eagerness to
7
accomplish the activity.
5 The student was not able to execute the program due to lack of interest in
the activity.

You might also like