chore(curriculum): fixed inaccuracies and added code tags in fcc author page new JS project (#50247)

fixed typos and added code tags
This commit is contained in:
Dario-DC
2023-05-02 19:26:55 +02:00
committed by GitHub
parent 5667f0eebf
commit 4a5c5c3cac
4 changed files with 4 additions and 4 deletions

View File

@@ -21,7 +21,7 @@ You should use `document.getElementById()` to get the `#author-container` elemen
assert.match(code, /document\.getElementById\(\s*('|"|`)author\-container\1\)/);
```
You should assign the `#authorContainer` element to the variable `authorContainer`. Don't forget to use `const` to declare the variable.
You should assign the `#author-container` element to the variable `authorContainer`. Don't forget to use `const` to declare the variable.
```js
assert.match(code, /const\s+authorContainer\s*\=\s*document\.getElementById\(\s*('|"|`)author\-container\1\)/);

View File

@@ -54,7 +54,7 @@ You should log the `res` parameter to the console so you can see the `Response`
assert.match(code, /fetch\(('|"|`)https:\/\/cdn\.freecodecamp\.org\/curriculum\/news\-author\-page\/authors\.json\1\)\s*\.then\(\(?res\)?\s*=>\s*console\.log\(res\)\)/)
```
You should have a semi-colon after your `.then()`.
You should not have a semi-colon after your `.then()`.
```js
assert.notMatch(code, /fetch\(('|"|`)https:\/\/cdn\.freecodecamp\.org\/curriculum\/news\-author\-page\/authors\.json\1\)\s*\.then\(\(?res\)?\s*=>\s*console\.log\(res\)\);/)

View File

@@ -7,7 +7,7 @@ dashedName: step-25
# --description--
If this condition is met, disable the button by setting its `disabled` property to `true`. Also, set the text content of the button to `No more data to load`.
If this condition is met, disable the button by setting its `disabled` property to `true`. Also, set the `textContent` of the button to `No more data to load`.
# --hints--

View File

@@ -9,7 +9,7 @@ dashedName: step-28
Finally, what if there's an error and the author data fail to load? Then we need to show an error in the UI. That's exactly what the `.catch()` method is for handling errors.
Inside the `.catch()`, remove the `console.error()` and set the `innerHTML` of the author container to a `p` element with the `class` `error-msg` and text `There was an error loading the authors`.
Inside the `.catch()`, remove the `console.error()` and set the `innerHTML` of the `authorContainer` to a `p` element with the `class` `error-msg` and text `There was an error loading the authors`.
# --hints--