fix(curriculum) - remove console.log(data) from step 9 and above for the leaderboard project (#52961)

This commit is contained in:
a2937 2024-01-09 13:11:27 -05:00 committed by GitHub
parent 7e5f090b04
commit 77fc74584f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
59 changed files with 11 additions and 62 deletions

View File

@ -253,7 +253,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
} catch (err) {
console.log(err);
}

View File

@ -16,13 +16,13 @@ Call the `showLatestPosts()` function at the end of your `try` block and pass in
You should call `showLatestPosts()` at the end of your `try` block.
```js
assert.match(code, /\s*console\.log\(data\);?\s*showLatestPosts\(.*\);??\s*/);
assert.match(code, /\s*showLatestPosts\(.*\);??\s*/);
```
You should pass `data` as the argument to `showLatestsPosts()`.
```js
assert.match(code, /\s*console\.log\(data\);?\s*showLatestPosts\(data\);?\s*/);
assert.match(code, /\s*showLatestPosts\(data\);?\s*/);
```
# --seed--
@ -242,8 +242,7 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
} catch (err) {
console.log(err);
}

View File

@ -233,7 +233,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -235,7 +235,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -255,7 +255,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -242,7 +242,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -241,7 +241,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -233,7 +233,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -248,7 +248,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -237,7 +237,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -233,7 +233,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -263,7 +263,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -245,7 +245,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -246,7 +246,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -247,7 +247,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -248,7 +248,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -249,7 +249,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -251,7 +251,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -252,7 +252,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -269,7 +269,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -271,7 +271,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -269,7 +269,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -257,7 +257,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -285,7 +285,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -267,7 +267,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -281,7 +281,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -267,7 +267,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -265,7 +265,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -290,7 +290,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -288,7 +288,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -283,7 +283,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -286,7 +286,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -307,7 +307,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -292,7 +292,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -307,7 +307,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -308,7 +308,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -301,7 +301,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -311,7 +311,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -311,7 +311,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -330,7 +330,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -301,7 +301,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -310,7 +310,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -312,7 +312,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -328,7 +328,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -307,7 +307,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -325,7 +325,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -322,7 +322,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -353,7 +353,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -321,7 +321,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -323,7 +323,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -323,7 +323,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -318,7 +318,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -321,7 +321,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);
@ -664,7 +663,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -239,7 +239,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -11,6 +11,8 @@ If there is an error from the `fetch` call, the `catch` block will handle it.
Inside the `catch` block, add a `console.log` to log the `err` parameter.
Also, remove your `console.log(data);` from your `try` block now that you understand what is being returned from the `fetch` call.
# --hints--
You should use `console.log` to log the `err` variable.
@ -25,6 +27,12 @@ Your `console.log` should be inside the `catch` block.
assert.match(code, /\s*try\s*{[^}]*\s*}\s*catch\s*\(\s*err\s*\)\s*{[^}]*\s*console\.log\(\s*err\s*\)[^}]*}/);
```
You should remove `console.log(data);` from the `try` block.
```js
assert.notMatch(code, /\s*console\.log\(\s*data\s*\)/);
```
# --seed--
## --seed-contents--

View File

@ -276,7 +276,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -303,7 +303,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -306,7 +306,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);

View File

@ -307,7 +307,6 @@ const fetchData = async () => {
try {
const res = await fetch(forumLatest);
const data = await res.json();
console.log(data);
showLatestPosts(data);
} catch (err) {
console.log(err);