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>
pull/41787/head
Sem Bauke 2021-04-09 14:34:55 +02:00 committed by GitHub
parent 6325c071fb
commit 21c8500f94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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!`
```js
assert(result == 'Hello, World!');
assert(result === 'Hello, World!');
```
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/));
```
The `result` variable should not be set equal to a string.
The `result` variable should not directly be set to a string
```js
assert(!code.match(/result\s*=\s*".*?"/));
assert(!code.match(/result\s*=\s*["'`].*?["'`]/));
```
# --seed--