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:
Sushil Gupta
2024-02-02 16:09:32 +05:30
committed by GitHub
parent 1e0a7edf9e
commit 271c8bd318
2 changed files with 12 additions and 6 deletions

View File

@@ -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--

View File

@@ -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--