Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In the lecture, we should incorporate some array to have a review in your new lo

ID: 3890971 • Letter: I

Question

In the lecture, we should incorporate some array to have a review in your new loop programming (specifically, for … in loop). In your text editor, create the script listed in the following, save it as arrayforin.html

<html>

<head>

<title>Array,Loops and Control</title>

</head>

<body>

<script>

var days =['Sun','Mon','Tue','Wed','Thr','Fri','Sat'];

var message="";

for (i in days) {

message +='Day' + i + 'is' +days[i] +' ';

}

alert(message);

</script>

<body>

</html>

Explanation / Answer

1. open notepad

2. copy whole text as listed below:-

<html>

<head>

<title>Array,Loops and Control</title>

</head>

<body>

<script>

var days =['Sun','Mon','Tue','Wed','Thr','Fri','Sat'];

var message="";

for (i in days) {

message +='Day ' + i + ' is ' +days[i] +' ';

}

alert(message);

</script>

<body>

</html>

3. save it as arrayforin.html

4. run the file or browser.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote