From 21c8500f94ab3103dbc3757350e2aaefbbfa3471 Mon Sep 17 00:00:00 2001 From: Sem Bauke <46919888+Sembauke@users.noreply.github.com> Date: Fri, 9 Apr 2021 14:34:55 +0200 Subject: [PATCH] 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> --- .../remove-whitespace-from-start-and-end.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.md index dfac829bd7..6caed07bf8 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.md @@ -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--