Skip to content

Commit

Permalink
fix(curriculum): match literal dot (freeCodeCamp#56848)
Browse files Browse the repository at this point in the history
  • Loading branch information
gikf authored Oct 25, 2024
1 parent 9b6735a commit d3c579d
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ Below that `console.log`, add another `console.log` that calls the `calculateSum
You should have a `console.log` that calls the `calculateSum` function with the arguments `10` and `10`.

```js
assert.match(code, /console.log\(calculateSum\(10\s*,\s*10\)\)/);
assert.match(code, /console\.log\(calculateSum\(10\s*,\s*10\)\)/);
```

You should have a `console.log` that calls the `calculateSum` function with the arguments `5` and `5`.

```js
assert.match(code, /console.log\(calculateSum\(5\s*,\s*5\)\)/);
assert.match(code, /console\.log\(calculateSum\(5\s*,\s*5\)\)/);
```

# --seed--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ After nesting the anchor (`a`) element, the only `p` element content visible in

```js
const pText = document.querySelectorAll('footer > p')[0].innerText.toLowerCase().replace(/\s+/g, ' ');
assert.match(pText, /^no copyright - freecodecamp.org$/);
assert.match(pText, /^no copyright - freecodecamp\.org$/);
```

# --seed--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ assert.equal(greeting, "My name is teacherBot.");
You should have a `console` statement that logs the `greeting` variable to the console.

```js
assert.match(code, /console.log\(.*greeting.*\)/);
assert.match(code, /console\.log\(.*greeting.*\)/);
```

# --seed--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Remember to replace `[subject]` with the `subject` variable and use proper templ
Your `console` statement should output the message `Here is an example of accessing the first letter in the word [subject].`.

```js
assert.match(code, /console.log\(`Here\s+is\s+an\s+example\s+of\s+accessing\s+the\s+first\s+letter\s+in\s+the\s+word\s+\${subject}\.`\);?/);
assert.match(code, /console\.log\(`Here\s+is\s+an\s+example\s+of\s+accessing\s+the\s+first\s+letter\s+in\s+the\s+word\s+\${subject}\.`\);?/);
```

# --seed--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Inside the `console` statement, output the first letter of the `subject` variabl
Your `console` statement should output the first letter of the `subject` variable using bracket notation and index `0`.

```js
assert.match(code, /console.log\(subject\[0\]\);?/);
assert.match(code, /console\.log\(subject\[0\]\);?/);
```

# --seed--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ Then add another `console` statement that outputs the second letter of the `subj
Your `console` statement should output the message `Here is an example of accessing the second letter in the word [subject].`.

```js
assert.match(code, /console.log\(`Here\s+is\s+an\s+example\s+of\s+accessing\s+the\s+second\s+letter\s+in\s+the\s+word\s+\$\{subject\}\.`\);?/);
assert.match(code, /console\.log\(`Here\s+is\s+an\s+example\s+of\s+accessing\s+the\s+second\s+letter\s+in\s+the\s+word\s+\$\{subject\}\.`\);?/);
```

You should have another `console` statement that outputs the second letter of the `subject` variable using bracket notation index `1`.

```js
assert.match(code, /console.log\(subject\[1\]\);?/);
assert.match(code, /console\.log\(subject\[1\]\);?/);
```

# --seed--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Remember to replace `[subject]` with the actual value of the `subject` variable
Your `console` statement should output the message `Here is an example of accessing the last letter in the word [subject].` Remember to use the correct template literal syntax.

```js
assert.match(code, /console.log\(`Here\s+is\s+an\s+example\s+of\s+accessing\s+the\s+last\s+letter\s+in\s+the\s+word\s+\${subject}\.`\);?/);
assert.match(code, /console\.log\(`Here\s+is\s+an\s+example\s+of\s+accessing\s+the\s+last\s+letter\s+in\s+the\s+word\s+\${subject}\.`\);?/);
```

# --seed--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ assert.strictEqual(lastCharacter, subject[subject.length - 1]);
You should log the value of the `lastCharacter` variable to the `console`.

```js
assert.match(code, /console.log\(lastCharacter\)/);
assert.match(code, /console\.log\(lastCharacter\)/);
```

# --seed--
Expand Down

0 comments on commit d3c579d

Please sign in to comment.