mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-30 16:01:14 -04:00
chore(curriculum):add quote to text and string in Building a Date Formatter project (#53948)
This commit is contained in:
@@ -15,7 +15,7 @@ element.addEventListener("change", () => {
|
||||
});
|
||||
```
|
||||
|
||||
Attach the `addEventListener` method to the `dateOptionsSelectElement`. The first argument of the event listener should be the string `change` and the second argument should be an empty arrow function.
|
||||
Attach the `addEventListener` method to the `dateOptionsSelectElement`. The first argument of the event listener should be the string `"change"` and the second argument should be an empty arrow function.
|
||||
|
||||
# --hints--
|
||||
|
||||
@@ -25,7 +25,7 @@ You should attach the `addEventListener` method to the `dateOptionsSelectElement
|
||||
assert(code.match(/dateOptionsSelectElement\.addEventListener\s*\(/g));
|
||||
```
|
||||
|
||||
Your event listener should listen for a `change` event.
|
||||
Your event listener should listen for a `"change"` event.
|
||||
|
||||
```js
|
||||
assert(code.match(/dateOptionsSelectElement\.addEventListener\s*\(\s*('|")change\1/g));
|
||||
|
||||
@@ -9,7 +9,7 @@ dashedName: step-17
|
||||
|
||||
When the user chooses the `Year, Month, Day` option from the dropdown, the date format should reflect this choice.
|
||||
|
||||
To do this, you can add a `case` clause in the `switch` statement that checks for a match against the expression `expr`, followed by code to run if there's a match. Here's an example where the `case` clause checks that `expr` is equal to the string `case123`:
|
||||
To do this, you can add a `case` clause in the `switch` statement that checks for a match against the expression `expr`, followed by code to run if there's a match. Here's an example where the `case` clause checks that `expr` is equal to the string `"case123"`:
|
||||
|
||||
```js
|
||||
switch (expr) {
|
||||
@@ -18,12 +18,12 @@ switch (expr) {
|
||||
}
|
||||
```
|
||||
|
||||
Add a `case` where the value is `yyyy-mm-dd`. Inside the `case`, set the text content of `currentDateParagraph` to the value of `formattedDate`.
|
||||
Add a `case` where the value is `"yyyy-mm-dd"`. Inside the `case`, set the text content of `currentDateParagraph` to the value of `formattedDate`.
|
||||
|
||||
|
||||
# --hints--
|
||||
|
||||
You should add a `case` where the condition is `yyyy-mm-dd`. Then set the `textContent` property of `currentDateParagraph` equal to `formattedDate`.
|
||||
You should add a `case` where the condition is `"yyyy-mm-dd"`. Then set the `textContent` property of `currentDateParagraph` equal to `formattedDate`.
|
||||
|
||||
```js
|
||||
assert(code.match(/case\s*('|")yyyy-mm-dd\1\s*:\s*currentDateParagraph\.textContent\s*=\s*formattedDate/g));
|
||||
|
||||
@@ -7,13 +7,13 @@ dashedName: step-22
|
||||
|
||||
# --description--
|
||||
|
||||
Add another `case` with the value `mm-dd-yyyy-h-mm`. Inside that `case`, set the text content of `currentDateParagraph` to empty template literals.
|
||||
Add another `case` with the value `"mm-dd-yyyy-h-mm"`. Inside that `case`, set the text content of `currentDateParagraph` to empty template literals.
|
||||
|
||||
Also, make sure to include a `break` statement to terminate the `switch` statement.
|
||||
|
||||
# --hints--
|
||||
|
||||
You should add a `case` where the condition is `mm-dd-yyyy-h-mm`, then set the `textContent` property of `currentDateParagraph` equal to empty template literals.
|
||||
You should add a `case` where the condition is `"mm-dd-yyyy-h-mm"`, then set the `textContent` property of `currentDateParagraph` equal to empty template literals.
|
||||
|
||||
```js
|
||||
assert(code.match(/case\s*('|")mm-dd-yyyy-h-mm\1\s*:\s*currentDateParagraph\.textContent\s*=\s*``/g));
|
||||
|
||||
Reference in New Issue
Block a user