Skip to content

Commit 3d48584

Browse files
author
Arthur
committed
Update sprint 1
1 parent 5e38349 commit 3d48584

3 files changed

Lines changed: 22 additions & 6 deletions

File tree

Sprint-1/1-key-exercises/1-count.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ count = count + 1;
55

66
// Line 1 is a variable declaration, creating the count variable with an initial value of 0
77
// Describe what line 3 is doing, in particular focus on what = is doing
8+
In line 3 , the new item adds 1 to turn count into a new value .
9+
10+
1 adds into an old value and update its own value , it becomes a new value now.

Sprint-1/1-key-exercises/3-paths.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,19 @@ console.log(`The base part of ${filePath} is ${base}`);
1818

1919
const dir = filePath.slice(0, lastSlashIndex);
2020

21-
// Create a variable to store the dir part of the filePath variable
21+
// Create a variable to store the dir part of the filePath
22+
const ext = filePath.slice(filePath.lastIndexOf(".") + 1);
23+
2224
// Create a variable to store the ext part of the variable
2325

2426

25-
// https://www.google.com/search?q=slice+mdn
27+
// https://www.google.com/search?q=slice+mdn
28+
29+
30+
31+
32+
33+
34+
35+
36+

Sprint-1/2-mandatory-errors/1.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// trying to create an age variable and then reassign the value by 1
2-
function X(num){
3-
const age = num +1;
4-
return age;}
5-
console.log(X(33));
2+
3+
let age = 0; // Initialize the age variable
4+
age = age + 1; // Reassign the value by 1
5+
console.log(age);
6+
7+

0 commit comments

Comments
 (0)