Skip to content

Commit a0733dc

Browse files
committed
Run format.mjs
1 parent 7c5a6f0 commit a0733dc

File tree

7 files changed

+19
-0
lines changed

7 files changed

+19
-0
lines changed

concepts/callbacks/about.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ You see this pattern often when dealing with asynchronous functions to assist wi
8181
Common `Array` functions use callback functions to define their behaviour:
8282

8383
- `Array.prototype.forEach`:
84+
8485
- Accepts a callback, which applies the callback to each element of an array.
8586

8687
```javascript
@@ -91,6 +92,7 @@ Common `Array` functions use callback functions to define their behaviour:
9192
```
9293

9394
- `Array.prototype.map`
95+
9496
- Accepts a callback, which applies the callback to each element of an array using the result to create a new array.
9597

9698
```javascript
@@ -101,6 +103,7 @@ Common `Array` functions use callback functions to define their behaviour:
101103
```
102104

103105
- `Array.prototype.reduce`
106+
104107
- Accepts a callback, which applies the callback to each element of an array, passing the result forward to the next invocation.
105108

106109
```javascript

concepts/closures/about.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The name _closure_ is historically derived from [_λ-calculus_][wiki-lambda-calc
1818
## Reasons to use closures in JavaScript
1919

2020
1. Data Privacy / Data Encapsulation
21+
2122
- Unlike other languages, in 2020, there was no way to specify _private_ variables. So closures can be used to effectively emulate _private_ variables (there was a proposal to introduce private variable notation, which might have become standard by the time you read this).
2223

2324
```javascript
@@ -36,6 +37,7 @@ The name _closure_ is historically derived from [_λ-calculus_][wiki-lambda-calc
3637
```
3738

3839
2. Partial Application
40+
3941
- Functions may return functions, and when a returned function uses the argument of the function that created it, this is an example of using a closure to perform partial application. Sometimes this is called _currying_ a function.
4042

4143
```javascript

exercises/concept/amusement-park/.meta/design.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,26 @@ This exercise could benefit from the following rules in the [analyzer][analyzer]
3232
The comment types mentioned below only serve as a proposal.
3333

3434
1. `createVisitor`
35+
3536
- `actionable`: If the student used a helper variable, give feedback that the result can be returned directly.
3637
- `celebratory`: If the student used classes, celebrate but let them know it is not necessary throughout this exercise.
3738
- `informative`: If the student did not use the short-hand notation but wrote `name: name` etc instead, let them know how to shorten that.
3839
The solution should be accepted nevertheless.
3940

4041
2. `revokeTicket`
42+
4143
- `essential`: Check the ticketId field is not deleted and re-added.
4244
- `celebratory`: If they used a method on a visitor class, celebrate but let them know it is not necessary for this exercise.
4345

4446
3. `ticketStatus`
47+
4548
- `essential`: Using a type switch should be discouraged since it is confusing to read because of the `typeof null === 'object'` quirk.
4649
- `informative`: If the student did not use early returns, maybe let them know about this alternative.
4750
- `celebratory`: Congratulate if the student used a template string for the "sold" case
4851
- `celebratory`: Congratulate if the student used a `value` helper variable.
4952

5053
4. `simpleTicketStatus`
54+
5155
- `essential`: Check `??` was used and not an if-statement or something else.
5256
- `actionable`: If the student used a helper variable, give feedback that the result can be returned directly.
5357

exercises/concept/bird-watcher/.meta/design.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ This exercise could benefit from the following rules in the [analyzer][analyzer]
3636
For all tasks check that the student actually used a for loop.
3737

3838
1. `totalBirdCount`
39+
3940
- Verify that the condition is written with `< x.length` instead of `<= y.length -1`.
4041
- Check whether a shorthand assignment `+=` was used to increase the sum (non-essential feedback).
4142
- Verify the total was properly initialized with `0` instead of e.g. `null`
4243
- Verify the increment operator was used in loop header step
4344

4445
2. `birdsInWeek`
46+
4547
- Verify a helper variable was used instead of duplicating the calculation in the initialization and condition of the loop
4648
- Other checks should be the same as for `totalBirdCount`
4749

exercises/concept/high-score-board/.meta/design.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,27 @@ The Concepts this exercise unlocks are:
4040
This exercise could benefit from the following rules in the [analyzer][analyzer]:
4141

4242
1. `createScoreBoard`
43+
4344
- `essential`: Make sure no class, map etc. was created, there should be just an object.
4445
- `actionable`: If the student created an empty object first and then added the value, give feedback to include the entry in the object literal directly.
4546
- `actionable`: Check that the object was returned directly, no intermediate assignment to a variable necessary.
4647

4748
2. `addPlayer`
49+
4850
- `essential`: Check the assignment operator was used and no additional variables were declared.
4951

5052
3. `removePlayer`
53+
5154
- `essential`: Make sure `delete` was used and not set to undefined or null.
5255
- `actionable`: If there is additional code to check whether the key is present before deleting it, give feedback that this is not necessary.
5356

5457
4. `updateScore`
58+
5559
- `actionable`: If the student used a separate variable to calculate the new value first, tell them it is not necessary.
5660
- `actionable`: If the student did not use the shorthand assignment operator, tell them about it. If they used it already, give a `celebratory` comment.
5761

5862
5. `applyMondayBonus`
63+
5964
- `essential`: Check the student actually used `for...in`.
6065
- Same feedback as in `updateScore` applies.
6166
- Using `updateScore` in the solution should be treated as equally correct as the exemplar solution.

exercises/concept/mixed-juices/.meta/design.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ This exercise could benefit from the following rules in the [analyzer][analyzer]
3838
The comment types mentioned below only serve as a proposal.
3939

4040
1. `timeToMixJuice`
41+
4142
- `essential`: Verify the student used a switch statement.
4243
Would be nice if we could give different feedback depending on what the student used instead.
4344
If it was if-else, comment that switch is better suited for so many different variants.
@@ -52,6 +53,7 @@ The comment types mentioned below only serve as a proposal.
5253
```
5354

5455
2. `limesToCut`
56+
5557
- A solution that uses `if (limes.length < 0) break;` instead of combining the conditions should be considered equally correct to the exemplar solution.
5658
The version in the exemplar file is shorter but the break version emphasizes that there is a special edge case.
5759
- `essential`: Verify that `while` was used.

exercises/concept/ozans-playlist/.meta/design.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ This exercise could benefit from the following rules in the [analyzer][analyzer]
3535
For all tasks, verify that the student actually used a `Set`.
3636

3737
1. `addTrack`
38+
3839
- Verify that there was no redundant `Set.has()` call
3940

4041
2. `deleteTrack`

0 commit comments

Comments
 (0)