Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

Commit b4eafbe

Browse files
authored
Merge pull request #384 from dubchoi/main
Swap exercises w/ week3 to match the syllabus.
2 parents 9434d5b + 0773e5b commit b4eafbe

File tree

16 files changed

+100
-255
lines changed

16 files changed

+100
-255
lines changed

exercises/H-array-literals/README.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

exercises/H-array-literals/exercise.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

exercises/H-while-loop/exercise.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
while loops can be useful when you want to execute some code as long as some condition is true.
3+
4+
Using a while loop, complete the function below so it logs (using console.log) the first n even numbers as a comma-seperated string.
5+
The list of numbers should start with 0. n is being passed in as a parameter.
6+
*/
7+
8+
function evenNumbers(n) {
9+
// TODO
10+
}
11+
12+
evenNumbers(3); // should output 0,2,4
13+
evenNumbers(0); // should output nothing
14+
evenNumbers(10); // should output 0,2,4,6,8,10,12,14,16,18

exercises/I-array-properties/README.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

exercises/I-array-properties/exercise.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

exercises/I-for-loop/exercise1.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
for loops can be useful when we already know exactly how many times we want to loop.
3+
4+
Change the while loop below into a for loop.
5+
*/
6+
7+
8+
// Change the below code to use a for loop instead of a while loop.
9+
let i = 0;
10+
while(i < 26) {
11+
console.log(String.fromCharCode(97 + i));
12+
i++;
13+
}
14+
// The output shouldn't change.

exercises/J-array-get-set/README.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

exercises/J-array-get-set/exercise.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

exercises/J-array-get-set/exercises2.js

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/*
2+
A for-of loop is a easy and way of looping through the elements of an array, string or any other "iterable object" (think sequence of elements).
3+
*/
4+
5+
// TODO Use a for-of loop to capitalise and output each letter in the string seperately.
6+
let str = "codeyourfuture";

0 commit comments

Comments
 (0)