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

Commit 22ae1a8

Browse files
committed
Reduce homework, add flipped clasroom material
1 parent f5caf65 commit 22ae1a8

File tree

2 files changed

+167
-16
lines changed

2 files changed

+167
-16
lines changed

docs/js-core-1/week-3/homework.md

Lines changed: 140 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,138 @@ title: Coursework
44
sidebar_label: Coursework
55
---
66

7+
## 0) Flipped Classroom Practice (3h)
8+
9+
The video playlist contains one "practice" video for each content video.
10+
11+
Here is an overview of the practice exercises:
12+
13+
0.1 After copy-pasting the function into the node REPL, predict, evaluate and explain the following expressions
14+
15+
```js
16+
function getTruthiness(expression) {
17+
if (expression) {
18+
return true;
19+
} else {
20+
return false;
21+
}
22+
}
23+
24+
getTruthiness(0); // make your prediction here
25+
getTruthiness(4);
26+
getTruthiness(-1);
27+
getTruthiness("");
28+
getTruthiness("hello");
29+
getTruthiness(undefined);
30+
getTruthiness();
31+
```
32+
33+
0.2 After copy-pasting the function into the node REPL, predict, evaluate and explain the following expressions
34+
35+
```js
36+
function getPhoneNumber(number, prefix) {
37+
if (prefix) {
38+
if (number.startsWith("0")) {
39+
number = number.substring(1); // substring(1) removes one character at the start of the string
40+
}
41+
return `${prefix}${number}`;
42+
} else {
43+
return `${number}`;
44+
}
45+
}
46+
47+
getPhoneNumber("073858489"); // make your prediction here
48+
getPhoneNumber("73858489", "+49");
49+
getPhoneNumber("073858489", "+33");
50+
```
51+
52+
1.1 Predict, evaluate and explain the following expressions in the node REPL
53+
54+
```js
55+
let animals = ["cat", "dog", "cow"];
56+
57+
animals; // make your prediction here
58+
animals.length;
59+
animals[1];
60+
animals[0];
61+
62+
animals[2] = "mouse";
63+
animals;
64+
65+
animals[3] = "elephant";
66+
animals.length;
67+
animals;
68+
```
69+
70+
1.1 Write a program that defines an array: `const colours = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"];`
71+
72+
The program should print out to the console:
73+
74+
```
75+
The 2nd colour in a rainbow is orange (counting from 1)
76+
There are 7 colours in a rainbow
77+
```
78+
79+
Modify the initial value of the array so that it is `const colours = ["yellow", "green", "blue", "indigo", "violet"];`
80+
81+
Predict and check what your program will now print out.
82+
83+
2.1 Write a program that defines an array (these are the steps I took last week): `const stepCounts = [2211, 11745, 7390, 14284, 7902];`
84+
85+
Incrementally create your program so that it prints out to the console the steps taken on each day
86+
87+
```
88+
2211
89+
11745
90+
7390
91+
14284
92+
7902
93+
```
94+
95+
2.2 Then add the total number of steps taken
96+
97+
```
98+
2211
99+
11745
100+
7390
101+
14284
102+
7902
103+
There were 43532 total Steps
104+
```
105+
106+
2.3 Last add the number of days where the steps were over 10000
107+
108+
```
109+
2211
110+
11745
111+
7390
112+
14284
113+
7902
114+
There were 43532 total Steps
115+
You met your goal of 10000 steps 2 times
116+
```
117+
118+
3.1 Predict, evaluate and explain the following expressions in the node REPL
119+
120+
```js
121+
const dinosaurs = ["t-rex", "stegosaurus", "velociraptor"];
122+
123+
dinosaurs;
124+
dinosaurs.length;
125+
dinosaurs.push("diplodocus");
126+
dinosaurs.push("iguanadon");
127+
dinosaurs;
128+
dinosaurs.length;
129+
```
130+
131+
3.2 Write a program that defines an array of names: `const names = ["Karin", "Fatemeh", "Luke", "Michael", "Douglas", "Jyoti"];`
132+
133+
Create a new array containing only the names with less than 7 letters and print it out to the console:
134+
135+
```
136+
The short names are [ 'Karin', 'Luke', 'Jyoti' ]
137+
```
138+
7139
## 1) Review Solutions for Last Weeks Coursework (45 minutes)
8140

9141
You should do this every week. We will stop reminding you next week.
@@ -15,29 +147,21 @@ Once you have access to the solutions repo, review your work compared to the exa
15147

16148
Write down your target areas and take them to your buddy group. What does your mentor think? Do they agree with your assessment?
17149

18-
## 3) JavaScript Exercises (3 hours)
19-
20-
These exercises will help solidify your knowledge of JavaScript. Open the "Exercises" folder and complete all of the challenges.
21-
22-
Before you start, **make sure you fork the repository** to your Github account.
23-
24-
https://github.com/CodeYourFuture/JavaScript-Core-1-Coursework-Week3
25-
26-
## 4) JavaScript Challenges (10 hours)
150+
## 2) JavaScript Challenges (10 hours)
27151

28152
Next, in the same repository complete all of the exercises in the "Mandatory" folder.
29153

30154
https://github.com/CodeYourFuture/JavaScript-Core-1-Coursework-Week3
31155

32-
## 5) Code review in your Buddy Group
156+
## 3) Code review in your Buddy Group
33157

34158
Code review is a valuable skill for a developer, and is a good way to practice talking about code with confidence. Let's level up our code review now.
35159

36160
1. Review Google's [engineering guide on code review](https://google.github.io/eng-practices/review/reviewer/comments.html).
37161
2. In your Buddy group, code review each of your colleague's nominated pull reqs.
38162
3. Stretch: Try [suggesting line changes](https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/incorporating-feedback-in-your-pull-request#applying-suggested-changes), and accepting them yourself:
39163

40-
## 6) Codewars (1 hour)
164+
## 4) Codewars (1 hour)
41165

42166
https://docs.codeyourfuture.io/course-processes/running-the-course/codewars
43167

@@ -47,21 +171,21 @@ Find the collection for JS-1 Week 3 on the CodeYourFuture account: https://www.c
47171

48172
Have you found the [Troubleshooting Guide](https://docs.codewars.com/training/troubleshooting/) yet? :D
49173

50-
## 7) Learn About the Terminal part 2 (4 hours)
174+
## 5) Learn About the Terminal part 2 (4 hours)
51175

52176
Most developers spend a lot of time using something called the terminal. This week, you are going to follow a course to learn about the terminal - it has [its own homework page here](/git/terminal/homework) for you to work from.
53177

54178
You should have started this course last week. Complete it now.
55179

56-
## 8) (Stretch) Extra JavaScript Challenges
180+
## 6) (Stretch) Extra JavaScript Challenges
57181

58182
Have some extra time before our next class? Fill it with these harder challenges to help you stretch your abilities.
59183

60184
**Alert:** Some of these challenges might include concepts that we haven't taught you yet. You should expect to frequently encounter concepts you haven't been taught in class yet or at all. Learning how to tackle this is a crucial skill we are supporting you to develop. How will you handle this? Will you create a study group? Find a mentor? Ask for a session in class? It's your professional development, so take control of it.
61185

62186
https://github.com/CodeYourFuture/JavaScript-Core-1-Coursework-Week3
63187

64-
## 9) Giving constructive feedback (PD - 1 hr)
188+
## 7) Giving constructive feedback (PD - 1 hr)
65189

66190
Imagine yourself in one of the following scenarios. How would you prepare to give constructive feedback in that situation?
67191

@@ -74,10 +198,10 @@ Scenarios:
74198
- Your colleague keeps interrupting you and others in meetings
75199
- Your flatmate left dirty cups in the sink for several days
76200

77-
## 10) Working with your team (PD - 2 hr)
201+
## 8) Working with your team (PD - 2 hr)
78202

79203
Feedback from colleagues gives you insight into your career progress. Every week you will be requesting feedback from two people. This will give you insight into your progress on this course.
80204

81205
This week, invite a classmate for a call. Choose someone you have worked with in a small group. Invite your PD or Education Buddy too. Exchange feedback. Try to be helpful, candid, and kind.
82206

83-
Write a 250 word essay reflecting on your strengths and development areas. Use the feedback to help you write this essay.
207+
Write a 250 word essay reflecting on your strengths and development areas. Use the feedback to help you write this essay.

docs/js-core-1/week-3/mentors.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,33 @@ We highly recommend joining the relevant Slack Channel for this module. In this
1616

1717
For general Syllabus feedback and help you can post in [cyf-syllabus](https://codeyourfuture.slack.com/archives/C012UUW69S8)
1818

19+
## Flipped classroom recap/Q&A
20+
21+
The flipped classroom practice should have trainees
22+
23+
- Get a basic understanding of truthiness and falsiness (see notes below)
24+
- In particular, using an `if (argumentToFunction)` for functions with optional arguments
25+
- `let foo = val || "default value"` and `if (val && val.foo === 3)` are not yet covered
26+
- Write and run programs using basic array functionality
27+
- initialise an array: `const names = ["Biruk", "Ali", "Mitch"];`
28+
- access a zero-indexed element: `let ali = names[1];`
29+
- modify a zero-indexed element: `names[2] = "Jyoti"`
30+
- get the length of an array: `let countNames = names.length`
31+
- add elements to an array: `names.push("Zsolt")`
32+
- Iterate through an array using `for (const name of names) {console.log(name);}`
33+
- Iterate through an array using `for (let i=0; i<names.length; i++) {console.log(i, names[i])}`
34+
- it is not important at this stage for all trainees to understand this (it's included only for completeness as trainees will find these loops through stackoverflow/google)
35+
- equivalence between c-style for and while loop is not yet clarified
36+
- Note: array methods are not covered, particularly 2nd order functions: `.filter()`, `.map()`, `.forEach()`
37+
38+
Some questions/prompts that may be useful
39+
40+
- What does this program do? (show programs of varying degrees of complexity using arrays)
41+
- What does this expression evaluate to, using array expressions?
42+
- What kinds of data types have we seen so far? (without getting too technical, "string", "number", "boolean", "undefined"). What values are falsy/truthy?
43+
- What are some ways to iterate over an array? Why would we use one over the other?
44+
- Discuss solutions to practice exercises
45+
1946
## Notes on truthy, falsy, null, and undefined
2047

2148
This session is only to establish some initial habits of thought, especially around debugging. This is such a tricky idea to grasp and so helpful to understand, so talk a little bit about different errors produced by these states.

0 commit comments

Comments
 (0)