Skip to content

Commit 284d878

Browse files
committed
"done"
1 parent 57349e3 commit 284d878

File tree

4 files changed

+25
-16
lines changed

4 files changed

+25
-16
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.DS_Store
1+
.DS_Store
2+
node_modules/

functions/Exercise.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// let phrase = "JavaScript rocks!";
2+
// console.log(phrase[phrase.length - 8]);
3+
let groceryBag = ['bananas', 'apples', 'edamame', 'chips', 'cucumbers', 'milk', 'cheese'];
4+
let selectedItems = [];
5+
6+
selectedItems = groceryBag.slice(2, 5).sort();
7+
console.log(selectedItems);
8+
9+

how-to-write-code/test-1.js

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

loops/exercises/for-Loop-Exercises.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
// for (let i = -14; i < 12; i = i + 2) {
1414
// console.log(i);
1515
// }
16-
16+
// for (let i = 20; i < 50 % 3; i = i + 2) {
17+
// console.log(i);
18+
// }
1719

1820
/*Exercise #2:
1921
Initialize two variables to hold the string “LaunchCode” and the array [1, 5, ‘LC101’, ‘blue’, 42].
@@ -22,18 +24,21 @@ Initialize two variables to hold the string “LaunchCode” and the array [1, 5
2224
Construct ``for`` loops to accomplish the following tasks:
2325
a. Print each element of the array to a new line.
2426
b. Print each character of the string - in reverse order - to a new line. */
25-
let Name = "LaunchCode "
26-
let arr = [1,5,'LC101','blue',42]
27-
let reversed = ""
27+
// let name = "LaunchCode "
28+
// let arr = [1,5,'LC101','blue',42]
29+
// let reversed = ("");
2830
// for (let i = 0; i < arr.length; i++) {
2931
// console.log(arr[i]);
3032
// }
3133

32-
for (let i = 11; i < Name.length; i++) {
33-
reversed = Name[1] + reversed;
34-
console.log(reversed);
35-
}
34+
// for (let i = 0; i < name.length; i++) {
35+
// reversed = name[i] + reversed;
36+
// console.log(reversed);
37+
// }
3638

3739
/*Exercise #3:Construct a for loop that sorts the array [2, 3, 13, 18, -5, 38, -10, 11, 0, 104] into two new arrays:
3840
a. One array contains the even numbers, and the other holds the odds.
39-
b. Print the arrays to confirm the results. */
41+
b. Print the arrays to confirm the results. */
42+
let array = [2, 3, 13, 18, -5, 38, -10, 11, 0, 104]
43+
44+
for(i = 0; array.lenghth; ++i)

0 commit comments

Comments
 (0)