You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: javascript1/week4/exercises/level0.md
-3Lines changed: 0 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,6 @@
6
6
> [!IMPORTANT]
7
7
> These warm-up exercises are designed to ease you into the material. You don't need to complete all of them; instead, choose 1-2 sections that interest you and work on those. When you're ready for more challenging tasks, proceed to the [Level 1 exercises](./level1.md).
8
8
9
-
[!TIP]
10
-
> **Divide and Conquer** is a programming technique that breaks a problem into smaller, more manageable subproblems, solves them individually, and then combines their solutions to solve the original problem. It is used to reduce problem complexity and making it easier to implement a solution and estimate the effort required.
11
-
12
9
## 🎓 0.1 Running your Javascript
13
10
There are two main ways of running Javascript: Via the Browser or through the terminal using `node`
Copy file name to clipboardExpand all lines: javascript1/week4/exercises/level1.md
-22Lines changed: 0 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -48,14 +48,6 @@ Now help us answer these questions for the below students:
48
48
49
49
50
50
## ✨ 1.2 Review IMDB's code
51
-
> [!TIP]
52
-
> When refactoring existing code there is always a risk that we introduce bugs, so it is crucial that you take precautions to reduce the risk of introducing bugs. Here are some good steps to follow which limits these risks:
53
-
> 1.**🔍 Understand the Code**: Thoroughly read and understand the existing code.
54
-
> 2.**📝 Plan Changes**: Outline the changes you intend to make and weigh the effort required against the benefits.
55
-
> 3.**🧪 Create Test Scenarios**: Develop test scenarios and document their expected outcomes.
56
-
> 4.**💻 Implement Changes**: Make the necessary code changes.
57
-
> 5.**✅ Verify Functionality**: Ensure that your test scenarios still pass after the changes.
58
-
59
51
1. Describe in your own words to a team mate or mentor what this code does
60
52
2. The code is hard to read due to poor naming. Can you improve it? (there might be more than just the names to improve)
61
53
@@ -86,13 +78,6 @@ console.log(f(d));
86
78
87
79
88
80
## ✨ 1.3 Review the behaviour of JS
89
-
> [!TIP]
90
-
> When **reviewing** code now you want to watch out for:
91
-
> * Is all code required or can some be removed?
92
-
> * Are the naming of variables and functions good?
93
-
> * Is some code repeated which could be done with a function or a loop instead?
94
-
> * Are each function doing one thing really well?
95
-
96
81
Your niece found this script on the internet and is asking how it works.
97
82
1. Guess the output
98
83
2. Now run the code, did you guess correctly?
@@ -123,13 +108,6 @@ console.log("#10", a + h);
123
108
124
109
125
110
## 🔎 1.4 Troubleshoot issue with grades
126
-
> [!TIP]
127
-
> Effective troubleshooting involves a systematic approach:
128
-
> 1.**🔍 Understand the Problem**: Gather all relevant information and understand how to reproduce the issue.
129
-
> 2.**🕵️ Identify the Issue**: Locate where in the code the problem occurs and determine its cause.
130
-
> 3.**🔧 Develop a Solution**: Implement a fix for the issue.
131
-
> 4.**✅ Test the Solution**: Ensure the problem is resolved and no new issues have been introduced.
132
-
133
111
Below is a piece of code that is supposed to process a list of students and their grades, and return the average grade for the class. The calculation should ignore any invalid grades (negative numbers or non-numeric grades). However, the code has some bugs. Your task is to identify and fix the issues.
Copy file name to clipboardExpand all lines: javascript1/week4/exercises/level2.md
-10Lines changed: 0 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,6 @@
3
3
> [!IMPORTANT]
4
4
> These exercises will challenge all your skills so far. There will be less guidance compared to Level 1, and you may need to learn new topics independently. Choose an exercise that interests you. Once completed, if you seek an even greater challenge, proceed to the [Level 3 exercises](./level3.md). Otherwise, try another exercise here.
5
5
6
-
> [!TIP]
7
-
> Remember to take **breaks** once in a while to stretch and rest your eyes. The most productive people take regular breaks. Here are some ideas:
8
-
> * Work for 25 minutes, then take a 5-minute break.
9
-
> * Work for 50 minutes, then take a 15-minute break.
10
-
> * Work in 90-minute deep focus sessions, then take a 20–30 minute break.
11
-
12
-
13
6
## 🎓🧱 2.1 Implement a Calendar
14
7
1. Learn how we can work with dates in Javascript and explain it to a classmate and a mentor.
15
8
* How can I get today's date?
@@ -37,9 +30,6 @@
37
30
38
31
39
32
## 🎓✨ 2.2 Review NASA's Code
40
-
> [!TIP]
41
-
> **Don't Repeat Yourself (DRY)** is a principle in software development that encourages avoiding code duplication by using functions, loops, or reusable components. This helps to keep the codebase clean, maintainable, and easier to understand.
42
-
43
33
NASA has called you to review their code from the latest space mission. The current code works, but it’s inefficient. Identify repeated logic, unnecessary code, and ways to improve clarity.
44
34
1. The team member suggested that the code could be simplified using ternary operators, but what is that?
45
35
* Research what a ternary operator is and explain it to a team mate and a mentor
0 commit comments