fix(curriculum): prevent submitting array instead of string (#41720)
* fix(curriculum) prevent users from submitting an array instead of string * use strict equality instead of new test * Add suggestions from Tom Co-authored-by: Tom <20648924+moT01@users.noreply.github.com> Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
This commit is contained in:
@ -21,7 +21,7 @@ Write a regex and use the appropriate string methods to remove whitespace at the
|
|||||||
`result` should be equal to the string `Hello, World!`
|
`result` should be equal to the string `Hello, World!`
|
||||||
|
|
||||||
```js
|
```js
|
||||||
assert(result == 'Hello, World!');
|
assert(result === 'Hello, World!');
|
||||||
```
|
```
|
||||||
|
|
||||||
Your solution should not use the `String.prototype.trim()` method.
|
Your solution should not use the `String.prototype.trim()` method.
|
||||||
@ -30,10 +30,10 @@ Your solution should not use the `String.prototype.trim()` method.
|
|||||||
assert(!code.match(/\.?[\s\S]*?trim/));
|
assert(!code.match(/\.?[\s\S]*?trim/));
|
||||||
```
|
```
|
||||||
|
|
||||||
The `result` variable should not be set equal to a string.
|
The `result` variable should not directly be set to a string
|
||||||
|
|
||||||
```js
|
```js
|
||||||
assert(!code.match(/result\s*=\s*".*?"/));
|
assert(!code.match(/result\s*=\s*["'`].*?["'`]/));
|
||||||
```
|
```
|
||||||
|
|
||||||
# --seed--
|
# --seed--
|
||||||
|
Reference in New Issue
Block a user