-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut55.html
More file actions
77 lines (56 loc) · 1.77 KB
/
Copy pathtut55.html
File metadata and controls
77 lines (56 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Loops In Javascript</title>
</head>
<body>
<div class="container">
This is Loops
</div>
<script>
console.log("this is tutorial fiftyfive");
// let i = 0;
// for(i=0; i<3;i++){
// console.log(i)
// }
let friends = ["anand", "rohit", "preeti", "saniya", "aaysha"];
// for (let index = 0; index < friends.length; index++) {
// console.log("hello friend, " + friends[index]);
// }
// friends.forEach(function f(element){
// console.log("Hello friend, " + element + " to mordern javascript")
// })
// for (element of friends){
// console.log("hello friend, " + element + " To mordern javascript again")
// }
// let employee = {
// name : "Anand",
// salary : 2,
// channel : "Anand playz"
// }
// let employee = {
// name: "Anand"
// salary: 5000,
// channel : "anand playyz"
// }
// // use this loop to iterate over object in javascript
// for(key in employee){
// console.log(' the ${key} of employee is $(employee[key]');
// }
// while loop in javascript
let i = 0;
while(i<4){
console.log(`${i} is less than 4`);
i++ ;
}
// do while loop in javascript
let j = 34;
do{
console.log(` ${j} is less than 4 BUT we are inside do while loop `);
j++;
}while(j<34);
</script>
</body>
</html>