mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-10-24 23:49:06 +08:00
fix(curriculum): em dash adjusting (#63901)
This commit is contained in:
+9
-3
@@ -7,7 +7,9 @@ dashedName: step-9
|
||||
|
||||
# --description--
|
||||
|
||||
Below the block quotation element, add a paragraph element with the text `—Quincy Larson, How to Learn to Code and Get a Developer Job [Full Book]`.
|
||||
Below the block quotation element, add a paragraph element with the text `—Quincy Larson, How to Learn to Code and Get a Developer Job [Full Book]`.
|
||||
|
||||
`—` is an HTML entity that represents an em dash `—`.
|
||||
|
||||
# --hints--
|
||||
|
||||
@@ -17,11 +19,15 @@ You should have a `p` element below the `blockquote` element.
|
||||
assert.exists(document.querySelector('section:first-of-type > blockquote + p'));
|
||||
```
|
||||
|
||||
Your `p` element should have the text `—Quincy Larson, How to Learn to Code and Get a Developer Job [Full Book]`.
|
||||
Your `p` element should have the text `—Quincy Larson, How to Learn to Code and Get a Developer Job [Full Book]`.
|
||||
|
||||
```js
|
||||
const pEl = document.querySelector('section:first-of-type > blockquote + p');
|
||||
assert.equal(pEl?.innerText.trim(), '—Quincy Larson, How to Learn to Code and Get a Developer Job [Full Book]');
|
||||
const html = pEl?.innerHTML.trim();
|
||||
assert.oneOf(html, [
|
||||
'—Quincy Larson, How to Learn to Code and Get a Developer Job [Full Book]',
|
||||
'—Quincy Larson, How to Learn to Code and Get a Developer Job [Full Book]'
|
||||
]);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+2
-2
@@ -54,11 +54,11 @@ console.log("Result of trimming whitespace from both ends:");
|
||||
console.log(cleanedInput);
|
||||
|
||||
const trimmedStart = userInput.trimStart();
|
||||
console.log("After using the trimStart() method — leading spaces removed:");
|
||||
console.log("After using the trimStart() method, leading spaces removed:");
|
||||
console.log(trimmedStart);
|
||||
|
||||
const trimmedEnd = userInput.trimEnd();
|
||||
console.log("After using the trimEnd() method — trailing spaces removed:");
|
||||
console.log("After using the trimEnd() method, trailing spaces removed:");
|
||||
console.log(trimmedEnd);
|
||||
|
||||
--fcc-editable-region--
|
||||
|
||||
+2
-2
@@ -68,11 +68,11 @@ console.log("Result of trimming whitespace from both ends:");
|
||||
console.log(cleanedInput);
|
||||
|
||||
const trimmedStart = userInput.trimStart();
|
||||
console.log("After using the trimStart() method — leading spaces removed:");
|
||||
console.log("After using the trimStart() method, leading spaces removed:");
|
||||
console.log(trimmedStart);
|
||||
|
||||
const trimmedEnd = userInput.trimEnd();
|
||||
console.log("After using the trimEnd() method — trailing spaces removed:");
|
||||
console.log("After using the trimEnd() method, trailing spaces removed:");
|
||||
console.log(trimmedEnd);
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -86,11 +86,11 @@ console.log("Result of trimming whitespace from both ends:");
|
||||
console.log(cleanedInput);
|
||||
|
||||
const trimmedStart = userInput.trimStart();
|
||||
console.log("After using the trimStart() method — leading spaces removed:");
|
||||
console.log("After using the trimStart() method, leading spaces removed:");
|
||||
console.log(trimmedStart);
|
||||
|
||||
const trimmedEnd = userInput.trimEnd();
|
||||
console.log("After using the trimEnd() method — trailing spaces removed:");
|
||||
console.log("After using the trimEnd() method, trailing spaces removed:");
|
||||
console.log(trimmedEnd);
|
||||
|
||||
const upperCaseInput = cleanedInput.toUpperCase();
|
||||
|
||||
+2
-2
@@ -54,11 +54,11 @@ console.log("Result of trimming whitespace from both ends:");
|
||||
console.log(cleanedInput);
|
||||
|
||||
const trimmedStart = userInput.trimStart();
|
||||
console.log("After using the trimStart() method — leading spaces removed:");
|
||||
console.log("After using the trimStart() method, leading spaces removed:");
|
||||
console.log(trimmedStart);
|
||||
|
||||
const trimmedEnd = userInput.trimEnd();
|
||||
console.log("After using the trimEnd() method — trailing spaces removed:");
|
||||
console.log("After using the trimEnd() method, trailing spaces removed:");
|
||||
console.log(trimmedEnd);
|
||||
|
||||
const upperCaseInput = cleanedInput.toUpperCase();
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ console.log("Result of trimming whitespace from both ends:");
|
||||
console.log(cleanedInput);
|
||||
|
||||
const trimmedStart = userInput.trimStart();
|
||||
console.log("After using the trimStart() method — leading spaces removed:");
|
||||
console.log("After using the trimStart() method, leading spaces removed:");
|
||||
console.log(trimmedStart);
|
||||
|
||||
--fcc-editable-region--
|
||||
|
||||
+3
-3
@@ -9,7 +9,7 @@ dashedName: step-7
|
||||
|
||||
Now it is time to see the results of trimming whitespace at the beginning of the string.
|
||||
|
||||
Below your `trimmedStart` variable, add a `console.log()` with the string `"After using the trimStart() method — leading spaces removed:"`.
|
||||
Below your `trimmedStart` variable, add a `console.log()` with the string `"After using the trimStart() method, leading spaces removed:"`.
|
||||
|
||||
Then below that `console.log()`, add another `console.log()` with the `trimmedStart` variable.
|
||||
|
||||
@@ -22,10 +22,10 @@ const getLogs = () => spy.calls.map(call => call?.[0]);
|
||||
|
||||
# --hints--
|
||||
|
||||
You should log the string `"After using the trimStart() method — leading spaces removed:"` to the console.
|
||||
You should log the string `"After using the trimStart() method, leading spaces removed:"` to the console.
|
||||
|
||||
```js
|
||||
assert.equal(getLogs()[4], "After using the trimStart() method — leading spaces removed:");
|
||||
assert.equal(getLogs()[4], "After using the trimStart() method, leading spaces removed:");
|
||||
```
|
||||
|
||||
You should log the `trimmedStart` variable to the console.
|
||||
|
||||
+4
-4
@@ -9,7 +9,7 @@ dashedName: step-9
|
||||
|
||||
Now it is time to see the results of trimming whitespace at the end of the string.
|
||||
|
||||
Below your `trimmedEnd` variable, add a `console.log()` with the string `"After using the trimEnd() method — trailing spaces removed:"`.
|
||||
Below your `trimmedEnd` variable, add a `console.log()` with the string `"After using the trimEnd() method, trailing spaces removed:"`.
|
||||
|
||||
Then below that `console.log()`, add another `console.log()` with the `trimmedEnd` variable.
|
||||
|
||||
@@ -22,10 +22,10 @@ const getLogs = () => spy.calls.map(call => call?.[0]);
|
||||
|
||||
# --hints--
|
||||
|
||||
You should log the string `"After using the trimEnd() method — trailing spaces removed:"` to the console.
|
||||
You should log the string `"After using the trimEnd() method, trailing spaces removed:"` to the console.
|
||||
|
||||
```js
|
||||
assert.equal(getLogs()[6], "After using the trimEnd() method — trailing spaces removed:");
|
||||
assert.equal(getLogs()[6], "After using the trimEnd() method, trailing spaces removed:");
|
||||
```
|
||||
|
||||
You should log the `trimmedEnd` variable to the console.
|
||||
@@ -48,7 +48,7 @@ console.log("Result of trimming whitespace from both ends:");
|
||||
console.log(cleanedInput);
|
||||
|
||||
const trimmedStart = userInput.trimStart();
|
||||
console.log("After using the trimStart() method — leading spaces removed:");
|
||||
console.log("After using the trimStart() method, leading spaces removed:");
|
||||
console.log(trimmedStart);
|
||||
|
||||
--fcc-editable-region--
|
||||
|
||||
+2
-2
@@ -48,11 +48,11 @@ console.log("Result of trimming whitespace from both ends:");
|
||||
console.log(cleanedInput);
|
||||
|
||||
const trimmedStart = userInput.trimStart();
|
||||
console.log("After using the trimStart() method — leading spaces removed:");
|
||||
console.log("After using the trimStart() method, leading spaces removed:");
|
||||
console.log(trimmedStart);
|
||||
|
||||
const trimmedEnd = userInput.trimEnd();
|
||||
console.log("After using the trimEnd() method — trailing spaces removed:");
|
||||
console.log("After using the trimEnd() method, trailing spaces removed:");
|
||||
console.log(trimmedEnd);
|
||||
|
||||
--fcc-editable-region--
|
||||
|
||||
+2
-2
@@ -51,11 +51,11 @@ console.log("Result of trimming whitespace from both ends:");
|
||||
console.log(cleanedInput);
|
||||
|
||||
const trimmedStart = userInput.trimStart();
|
||||
console.log("After using the trimStart() method — leading spaces removed:");
|
||||
console.log("After using the trimStart() method, leading spaces removed:");
|
||||
console.log(trimmedStart);
|
||||
|
||||
const trimmedEnd = userInput.trimEnd();
|
||||
console.log("After using the trimEnd() method — trailing spaces removed:");
|
||||
console.log("After using the trimEnd() method, trailing spaces removed:");
|
||||
console.log(trimmedEnd);
|
||||
|
||||
const upperCaseInput = cleanedInput.toUpperCase();
|
||||
|
||||
+4
-4
@@ -50,11 +50,11 @@ console.log("Result of trimming whitespace from both ends:");
|
||||
console.log(cleanedInput);
|
||||
|
||||
const trimmedStart = userInput.trimStart();
|
||||
console.log("After using the trimStart() method — leading spaces removed:");
|
||||
console.log("After using the trimStart() method, leading spaces removed:");
|
||||
console.log(trimmedStart);
|
||||
|
||||
const trimmedEnd = userInput.trimEnd();
|
||||
console.log("After using the trimEnd() method — trailing spaces removed:");
|
||||
console.log("After using the trimEnd() method, trailing spaces removed:");
|
||||
console.log(trimmedEnd);
|
||||
|
||||
const upperCaseInput = cleanedInput.toUpperCase();
|
||||
@@ -85,11 +85,11 @@ console.log("Result of trimming whitespace from both ends:");
|
||||
console.log(cleanedInput);
|
||||
|
||||
const trimmedStart = userInput.trimStart();
|
||||
console.log("After using the trimStart() method — leading spaces removed:");
|
||||
console.log("After using the trimStart() method, leading spaces removed:");
|
||||
console.log(trimmedStart);
|
||||
|
||||
const trimmedEnd = userInput.trimEnd();
|
||||
console.log("After using the trimEnd() method — trailing spaces removed:");
|
||||
console.log("After using the trimEnd() method, trailing spaces removed:");
|
||||
console.log(trimmedEnd);
|
||||
|
||||
const upperCaseInput = cleanedInput.toUpperCase();
|
||||
|
||||
Reference in New Issue
Block a user