Skip to content

Commit 614f830

Browse files
RGHANILOOjdwilkin4
andauthored
refactor(curriculum): authors workshop step 7 description and tests update (freeCodeCamp#57081)
Co-authored-by: Jessica Wilkins <[email protected]>
1 parent 50cf693 commit 614f830

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

curriculum/challenges/english/25-front-end-development/workshop-fcc-authors-page/641da5462576784453146ec2.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,63 @@ dashedName: step-7
77

88
# --description--
99

10-
Now that you have the data you want, you can use it to populate the UI. But the fetched data contains an array of 26 authors, and if you add them all to the page at the same time, it could lead to poor performance.
10+
Now that you have the data you want, you can use it to populate the UI.
1111

12-
Instead, you should add 8 authors at a time, and have a button to add 8 more until there's no more data to display.
12+
But the data you are fetching will have a total of 26 authors. Instead of displaying all 26 authors at once, you should display 8 authors at a time.
1313

14-
Use `let` to create 2 variables named `startingIndex` and `endingIndex`, and assign them the number values `0` and `8`, respectively. Also, create an `authorDataArr` variable with `let` and set it to an empty array.
14+
Start by using the `let` keyword to create two variables named `startingIndex` and `endingIndex`, and assign them the numbers `0` and `8`, respectively. You will need to use `let` here because you will be reassigning these values later on.
15+
16+
Then, create an `authorDataArr` variable and assign it an empty array.
1517

1618
# --hints--
1719

1820
You should use `let` to declare a variable named `startingIndex`.
1921

2022
```js
21-
assert.match(code, /let\s+startingIndex/)
23+
assert.match(code, /let\s+startingIndex/);
2224
```
2325

24-
You should set your `startingIndex` variable to `0`.
26+
Your `startingIndex` variable should be a number.
2527

2628
```js
27-
assert.match(code, /let\s+startingIndex\s*=\s*0\s*;?/)
29+
assert.isNumber(startingIndex);
30+
```
31+
32+
Your `startingIndex` variable should be set to `0`.
33+
34+
```js
35+
assert.strictEqual(startingIndex, 0);
2836
```
2937

3038
You should use `let` to declare a variable named `endingIndex`.
3139

3240
```js
33-
assert.match(code, /let\s+endingIndex/)
41+
assert.match(code, /let\s+endingIndex/);
42+
```
43+
44+
Your `endingIndex` variable should be a number.
45+
46+
```js
47+
assert.isNumber(endingIndex);
3448
```
3549

3650
You should set your `endingIndex` variable to `8`.
3751

3852
```js
39-
assert.match(code, /let\s+endingIndex\s*=\s*8\s*;?/)
53+
assert.strictEqual(endingIndex, 8)
4054
```
4155

42-
You should use `let` to declare a variable named `authorDataArr`.
56+
You should have a variable named `authorDataArr`.
4357

4458
```js
45-
assert.match(code, /let\s+authorDataArr/)
59+
assert.isDefined(authorDataArr);
4660
```
4761

48-
You should set your `authorDataArr` variable to an empty array (`[]`).
62+
Your `authorDataArr` variable should be an empty array.
4963

5064
```js
51-
assert.match(code, /let\s+authorDataArr\s*=\s*\[\s*\]\s*;?/)
65+
assert.isArray(authorDataArr);
66+
assert.isEmpty(authorDataArr);
5267
```
5368

5469
# --seed--

0 commit comments

Comments
 (0)