Skip to content

Commit 3835f13

Browse files
Setting up starter code for Chapter 9
1 parent c27b117 commit 3835f13

5 files changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Experiment with this loop by modifying each of the following: the variable initialization, the boolean condition, and the update expression.
2+
3+
for (let i = 0; i < 51; i++) {
4+
console.log(i);
5+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
let str = "blue";
2+
let reversed = "";
3+
4+
for (let i = 0; i < str.length; i++) {
5+
reversed = str[i] + reversed;
6+
}
7+
8+
console.log(reversed);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// create an array variable containing the names
2+
3+
// write a for loop that prints each name on a different line
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Create a string variable containing your name.
2+
3+
4+
// Write a for loop that prints each character in your name on a different line.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
let i = 0;
2+
3+
while (i < 51) {
4+
console.log(i);
5+
i++;
6+
}

0 commit comments

Comments
 (0)