Skip to content

Commit 9b47ac3

Browse files
committed
add: for loop
1 parent 239dcac commit 9b47ac3

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

01-Basics/05-loop-for/app.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
function whileLoop(){
2+
let i = 0; // incremention
3+
while(i < 11){
4+
if( i === 5 ){
5+
i++;
6+
continue;
7+
}
8+
console.log(i);
9+
i++; // i = i + 1;
10+
}
11+
}
12+
13+
function forLoop(){
14+
for(let i = 0; i < 11; i++){
15+
if( i === 5 ){
16+
continue;
17+
}
18+
console.log(i);
19+
}

01-Basics/05-loop-for/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Learning JavaScript - Walker</title>
6+
<link rel="stylesheet" href="style.css">
7+
</head>
8+
<body>
9+
<h1>for Loop</h1>
10+
11+
<script src="app.js"></script>
12+
</body>
13+
</html>

01-Basics/05-loop-for/style.css

Whitespace-only changes.

0 commit comments

Comments
 (0)