Skip to content

Commit d34a9c0

Browse files
authored
refactor:description and tests for authors workshop step 01 (freeCodeCamp#57083)
1 parent 614f830 commit d34a9c0

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

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

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,39 @@ demoType: onLoad
88

99
# --description--
1010

11-
All the HTML and CSS for this project has been provided for you. You can take a look at the two files to familiarize yourself with them.
11+
In this workshop, you will learn how to work with the `fetch` API to load data from an external source and display it on a page filled with freeCodeCamp authors.
1212

13-
Start by getting the `#author-container` and `#load-more-btn` elements with the `.getElementById()` method. Assign them to the variables `authorContainer` and `loadMoreBtn`, respectively.
13+
All of the HTML and CSS for this workshop has been provided for you. You can take a look at the two files to familiarize yourself with them.
1414

15-
The variables will not change, so use `const` to declare them.
15+
When you are ready, start by accessing the `#author-container` and `#load-more-btn` elements. Remember you can use the `getElementById` or `querySelector` methods for this.
16+
17+
Then assign these elements to variables called `authorContainer` and `loadMoreBtn`, respectively.
1618

1719
# --hints--
1820

19-
You should use `document.getElementById()` to get the `#author-container` element.
21+
You should have a variable called `authorContainer`.
2022

2123
```js
22-
assert.match(code, /document\.getElementById\(\s*('|"|`)author\-container\1\s*\)/);
24+
assert.isDefined(authorContainer);
2325
```
2426

25-
You should assign the `#author-container` element to the variable `authorContainer`. Don't forget to use `const` to declare the variable.
27+
You should assign the `#author-container` element to the `authorContainer` variable.
2628

2729
```js
28-
assert.match(code, /const\s+authorContainer\s*\=\s*document\.getElementById\(\s*('|"|`)author\-container\1\s*\)/);
30+
assert.strictEqual(authorContainer, document.querySelector('#author-container'));
2931
```
3032

31-
You should use `document.getElementById()` to get the `#load-more-btn` element.
33+
You should have a variable called `loadMoreBtn`.
3234

3335
```js
34-
assert.match(code, /document\.getElementById\(\s*('|"|`)load\-more\-btn\1\s*\)/);
36+
assert.isDefined(loadMoreBtn);
3537
```
3638

37-
You should assign the `#load-more-btn` element to the variable `loadMoreBtn`. Don't forget to use `const` to declare the variable.
39+
You should assign the `#load-more-btn` element to the `loadMoreBtn` variable.
40+
3841

3942
```js
40-
assert.match(code, /const\s+loadMoreBtn\s*\=\s*document\.getElementById\(\s*('|"|`)load\-more\-btn\1\s*\)/);
43+
assert.strictEqual(loadMoreBtn, document.querySelector('#load-more-btn'));
4144
```
4245

4346
# --seed--

0 commit comments

Comments
 (0)