mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-12 01:00:13 -04:00
fix(curriculum): RPG - Step 40 - 41: Passing with wrong code (#53169)
Co-authored-by: Lasse Jørgensen <28780271+lasjorg@users.noreply.github.com>
This commit is contained in:
@@ -33,10 +33,10 @@ You should not use `let` or `const`.
|
||||
assert.notMatch(code, /(let|const)\s+button1\.onclick/);
|
||||
```
|
||||
|
||||
You should assign the `goStore` function reference to `button1.onclick`.
|
||||
You should assign the `goStore` function reference to `button1.onclick`. Make sure not to call the function.
|
||||
|
||||
```js
|
||||
assert.match(code, /button1\.onclick\s*=\s*goStore/);
|
||||
assert.match(code, /button1\.onclick\s*=\s*goStore\s*;?\s*$/m);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
@@ -13,6 +13,12 @@ Once you have done that, open your console and try clicking the buttons on your
|
||||
|
||||
# --hints--
|
||||
|
||||
You should assign the `goStore` function reference to `button1.onclick`. Make sure not to call the function.
|
||||
|
||||
```js
|
||||
assert.match(code, /button1\.onclick\s*=\s*goStore\s*;?\s*$/m);
|
||||
```
|
||||
|
||||
You should use dot notation to access the `onclick` property of `button2`.
|
||||
|
||||
```js
|
||||
@@ -25,10 +31,10 @@ You should not use `let` or `const` to assign `button2.onclick`.
|
||||
assert.notMatch(code, /(let|const)\s+button2\.onclick/);
|
||||
```
|
||||
|
||||
You should set the `onclick` property of `button2` to the variable `goCave`.
|
||||
You should assign the `goCave` function reference to `button2.onclick`. Make sure not to call the function.
|
||||
|
||||
```js
|
||||
assert.match(code, /button2\.onclick\s*=\s*goCave/);
|
||||
assert.match(code, /button2\.onclick\s*=\s*goCave\s*;?\s*$/m);
|
||||
```
|
||||
|
||||
You should use dot notation to access the `onclick` property of `button3`.
|
||||
@@ -43,10 +49,10 @@ You should not use `let` or `const` to assign `button3.onclick`.
|
||||
assert.notMatch(code, /(let|const)\s+button3\.onclick/);
|
||||
```
|
||||
|
||||
You should set the `onclick` property of `button3` to the variable `fightDragon`.
|
||||
You should assign the `fightDragon` function reference to `button3.onclick`. Make sure not to call the function.
|
||||
|
||||
```js
|
||||
assert.match(code, /button3\.onclick\s*=\s*fightDragon/);
|
||||
assert.match(code, /button3\.onclick\s*=\s*fightDragon\s*;?\s*$/m);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
Reference in New Issue
Block a user