fix(curriculum): strip comments from code when testing (#43597)
* fix: update ES6-Compare Scopes of var and let Fixes Issue: Adding a comment causes a valid answer to be wrong in ES6 > Compare Scopes of the var and let keywords Fixes: #43578 * Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/compare-scopes-of-the-var-and-let-keywords.md Co-authored-by: Krzysztof <60067306+gikf@users.noreply.github.com> * Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/compare-scopes-of-the-var-and-let-keywords.md Co-authored-by: Krzysztof <60067306+gikf@users.noreply.github.com> * Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/compare-scopes-of-the-var-and-let-keywords.md Co-authored-by: Krzysztof <60067306+gikf@users.noreply.github.com> Co-authored-by: Krzysztof <60067306+gikf@users.noreply.github.com>
This commit is contained in:
@ -85,16 +85,13 @@ This exercise is designed to illustrate the difference between how `var` and `le
|
||||
`var` should not exist in code.
|
||||
|
||||
```js
|
||||
(getUserInput) => assert(!getUserInput('index').match(/var/g));
|
||||
assert(!code.match(/var/g));
|
||||
```
|
||||
|
||||
The variable `i` declared in the `if` statement should equal the string `block scope`.
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
assert(
|
||||
getUserInput('index').match(/(i\s*=\s*).*\s*.*\s*.*\1('|")block\s*scope\2/g)
|
||||
);
|
||||
assert(code.match(/(i\s*=\s*).*\s*.*\s*.*\1('|")block\s*scope\2/g));
|
||||
```
|
||||
|
||||
`checkScope()` should return the string `function scope`
|
||||
|
Reference in New Issue
Block a user