From f6e50ac7b9e336b6e98d0c210cdec4d1edbe0cbb Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Fri, 21 Jun 2024 18:34:11 +0200 Subject: [PATCH] fix: remove comments from user code before test (#55113) --- .../660ee6e3a242da6bd579de69.md | 8 ++++---- .../660eebd83100d37862268781.md | 6 +++--- .../660ef0f7c4b8e68ccd1f0786.md | 8 ++++---- .../660ef19b95d3308e7dd31bb6.md | 8 ++++---- .../660ef31a5be625914a0102cd.md | 8 ++++---- .../660ef5105b8ba095307a0e50.md | 6 +++--- .../660ef55dd468079679ee0092.md | 6 +++--- .../660ef5c1904955978a986a5c.md | 4 ++-- .../660ef6355e8f5a9e67fe5f46.md | 6 +++--- .../660ef857f2806aa626d29d17.md | 2 +- .../660f033cf051ebb50ea3bf48.md | 4 ++-- .../660f061d259bbebc37461080.md | 10 +++++----- .../660f07d231941bc11719f664.md | 10 +++++----- .../660f09a2694b59c3a10ee304.md | 6 +++--- .../660f0a55847d6cc485f29ba5.md | 6 +++--- .../660f0c34aad72dc712b97624.md | 10 +++++----- .../660f0da9bf1035c9097af20a.md | 6 +++--- .../660f0ee51d7460ce88cd248d.md | 10 +++++----- .../660f0f980e98e8cf77f1ce31.md | 2 +- .../660f165270622fd4ec0da3f7.md | 8 ++++---- .../660f17d4e9f227d86e834abd.md | 10 +++++----- .../660f18f059fe0fda192ce394.md | 6 +++--- .../660f1a00ac619ddc1e259a66.md | 6 +++--- .../660f1b6e60bd9edf902c81fd.md | 6 +++--- .../660f1bf673487ae0bb25b900.md | 6 +++--- .../660f1cedf3676fe26122ebf6.md | 8 ++++---- .../660f1e3f047bf4e403268713.md | 4 ++-- .../660f20473aef47e9b8c9afc6.md | 4 ++-- .../660f207334fabaeac3269c38.md | 12 ++++++------ .../660f229d2dbe09ef2954a4a1.md | 6 +++--- .../660f23b53db70af0f2620e78.md | 8 ++++---- .../660f255022991ef34ed0ee88.md | 4 ++-- .../660f280dda5040f707c76b4a.md | 6 +++--- .../660f2a70ad6225fa503e71c3.md | 2 +- .../660f2b6fd54ac1fc142804dd.md | 6 +++--- .../660f2eccfe3f820304af1b39.md | 6 +++--- .../660f2fbd45b520046cac68e8.md | 8 ++++---- .../660f34626216270c682e2f7b.md | 6 +++--- .../660f34e99571070d56d2f231.md | 6 +++--- .../660f38c34a4de6141c0c369f.md | 4 ++-- .../660f3915b41a441537ec9f5e.md | 4 ++-- .../660f39b444fd6f16d1e49c1f.md | 2 +- .../660f3b664421471aa595170f.md | 4 ++-- .../660f3ba3cceef11b6ba08b59.md | 4 ++-- .../660f415b76859a2736771607.md | 6 +++--- .../660f4377a359972c521d3f4b.md | 2 +- .../660f4455f457ef2e3ec6920f.md | 2 +- .../660f447efc0e722f016c1be0.md | 2 +- .../660f44f10ea40f300b896a5e.md | 10 +++++----- .../660f455b044d3230ed971e98.md | 4 ++-- .../660f45ccf4ca5c31f253005a.md | 2 +- .../660f46460f9c36330ebc07d8.md | 2 +- .../660f46b9c417a8341729a3ab.md | 2 +- .../660f4774e3e0df35a68bb5f2.md | 8 ++++---- .../660f47afe4c98536715d5fa4.md | 2 +- .../660f487dc0c8fa38084f9754.md | 4 ++-- .../660f48a419b40238e2b8b4d5.md | 2 +- .../660f48e1d3682f39e81843c4.md | 2 +- .../660f4934fb48f63abd5ae371.md | 2 +- .../660f4990b1caa03b9dc97a43.md | 4 ++-- .../660f4a1472f8e63d76162ce5.md | 6 +++--- .../660f4a83373de83ea101685f.md | 2 +- .../660f4ae5b3924c3fc3373973.md | 2 +- .../660f4b33e2a3364094ecb540.md | 8 ++++---- .../660f4b641290da41b2cf0dd9.md | 4 ++-- .../660f4c3b01c44743719c99e4.md | 4 ++-- .../660f4cffb1459d45e34902d1.md | 4 ++-- .../660f4de78f775e480ba2e451.md | 4 ++-- .../660f4e74f7fd3f4a99ac2e50.md | 4 ++-- .../660f4efcb8068e4cb470dca1.md | 8 ++++---- .../660f505d02b2bd513a1c3468.md | 6 +++--- .../660f50a21fe7645252804f2b.md | 4 ++-- .../660f5179b3b0ca558f6b4d4f.md | 6 +++--- .../660f51f1df0a8757934a5796.md | 2 +- .../660f530d6e33d159e1bf4947.md | 4 ++-- .../660f535ec33a285b33af3774.md | 8 ++++---- .../660f53ad3d39175c5d4335ac.md | 4 ++-- .../6610b741b54b90f0c0fb3d58.md | 6 +++--- .../6610b8017d1671f2814e8c77.md | 4 ++-- .../6610b8f6a98d25f4d485a94d.md | 4 ++-- .../6610b9f7619764fad5fd516d.md | 2 +- .../6610bbed59bc2a0194d85533.md | 6 +++--- .../6610bf6fa14d700beed1b109.md | 4 ++-- .../6610c105bbdacc114d6cdc44.md | 2 +- .../6610c16c4fa0df12c0e30675.md | 6 +++--- .../6610c1d97b1671140f95cfbb.md | 4 ++-- .../6610c48c4ea0891afa7c4696.md | 2 +- .../6610c83b52583e245a079217.md | 4 ++-- .../6610c8cfe4cf4d278e35c156.md | 4 ++-- .../661483051820c3c1ab4595e0.md | 4 ++-- .../66458f0a05df478aa627629e.md | 6 +++--- .../664599653fcd6e97104f9261.md | 4 ++-- .../664ed9344ba3495e1f67f8ea.md | 8 ++++---- .../665732da4815b70bb083915e.md | 2 +- .../665732e62eb8b30c249b5c2c.md | 2 +- 95 files changed, 241 insertions(+), 241 deletions(-) diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ee6e3a242da6bd579de69.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ee6e3a242da6bd579de69.md index ac72cff5f7a..a2824263650 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ee6e3a242da6bd579de69.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ee6e3a242da6bd579de69.md @@ -28,25 +28,25 @@ _Note_: It is common practice to end statements in JavaScript with a semicolon. You should use `let` in your code. ```js -assert.match(code, /let/); +assert.match(__helpers.removeJSComments(code), /let/); ``` You should use `character` in your code. ```js -assert.match(code, /character/); +assert.match(__helpers.removeJSComments(code), /character/); ``` You should use `let` to declare a `character` variable. ```js -assert.match(code, /let\s+character/); +assert.match(__helpers.removeJSComments(code), /let\s+character/); ``` Your declaration should end with a semi-colon. ```js -assert.match(code, /let\s+character;/); +assert.match(__helpers.removeJSComments(code), /let\s+character;/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660eebd83100d37862268781.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660eebd83100d37862268781.md index b7009681264..94dc5014706 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660eebd83100d37862268781.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660eebd83100d37862268781.md @@ -22,19 +22,19 @@ Initialize your `character` variable by assigning it the value `"Hello"` during You should use the assignment operator `=`. ```js -assert.match(code, /let\s+character\s*=/); +assert.match(__helpers.removeJSComments(code), /let\s+character\s*=/); ``` You should use the string `"Hello"`. ```js -assert.match(code, /('|")Hello\1/); +assert.match(__helpers.removeJSComments(code), /('|")Hello\1/); ``` You should use double quotes for your `"Hello"` string. ```js -assert.match(code, /"Hello"/); +assert.match(__helpers.removeJSComments(code), /"Hello"/); ``` You should assign `"Hello"` to your `character` variable. diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef0f7c4b8e68ccd1f0786.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef0f7c4b8e68ccd1f0786.md index 89689276fb1..88f21417b97 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef0f7c4b8e68ccd1f0786.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef0f7c4b8e68ccd1f0786.md @@ -18,25 +18,25 @@ Change your `"Hello"` string to use single quotes. You should not have double quotes in your code. ```js -assert.notMatch(code, /"/); +assert.notMatch(__helpers.removeJSComments(code), /"/); ``` You should use single quotes for your `"Hello"` string. ```js -assert.match(code, /'Hello'/); +assert.match(__helpers.removeJSComments(code), /'Hello'/); ``` You should still use `let` in your code. ```js -assert.match(code, /let/); +assert.match(__helpers.removeJSComments(code), /let/); ``` You should still declare a `character` variable. ```js -assert.match(code, /let\s+character/); +assert.match(__helpers.removeJSComments(code), /let\s+character/); ``` Your `character` variable should still have the string `"Hello"` for its value. diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef19b95d3308e7dd31bb6.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef19b95d3308e7dd31bb6.md index 34a5eaaa68d..b5de37e00c6 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef19b95d3308e7dd31bb6.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef19b95d3308e7dd31bb6.md @@ -23,25 +23,25 @@ Print the value of the `character` variable to the console. Then, click the "Con You should access the `console` in your code. ```js -assert.match(code, /console/); +assert.match(__helpers.removeJSComments(code), /console/); ``` You should access the `log` property of the `console`. ```js -assert.match(code, /console\.log/); +assert.match(__helpers.removeJSComments(code), /console\.log/); ``` You should use parentheses to call the `.log()` method. ```js -assert.match(code, /console\.log\(/); +assert.match(__helpers.removeJSComments(code), /console\.log\(/); ``` You should print the `character` variable to the console. ```js -assert.match(code, /console\.log\(\s*character\s*\)/); +assert.match(__helpers.removeJSComments(code), /console\.log\(\s*character\s*\)/); ``` diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef31a5be625914a0102cd.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef31a5be625914a0102cd.md index f12fda30f7e..b4f33066cb8 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef31a5be625914a0102cd.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef31a5be625914a0102cd.md @@ -23,19 +23,19 @@ After your `console.log`, assign the value `"World"` to your `character` variabl You should use `character` twice in your code. ```js -assert.lengthOf(code.match(/character/g), 3); +assert.lengthOf(__helpers.removeJSComments(code).match(/character/g), 3); ``` You should use the assignment operator to reassign `character`. ```js -assert.lengthOf(code.match(/character\s*\=/g), 2); +assert.lengthOf(__helpers.removeJSComments(code).match(/character\s*\=/g), 2); ``` You should use the string `"World"` in your code. ```js -assert.match(code, /("|')World\1/); +assert.match(__helpers.removeJSComments(code), /("|')World\1/); ``` Your `character` variable should have the value `"World"`. @@ -47,7 +47,7 @@ assert.equal(character, "World"); Your reassignment should not use `let`. ```js -assert.isBelow(code.match(/let/g).length, 2); +assert.isBelow(__helpers.removeJSComments(code).match(/let/g).length, 2); ``` diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef5105b8ba095307a0e50.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef5105b8ba095307a0e50.md index 22b6cecafa5..19b5f6a67e9 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef5105b8ba095307a0e50.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef5105b8ba095307a0e50.md @@ -14,20 +14,20 @@ Now log your `character` variable to the console again. You should see the strin You should use `console.log` a second time. ```js -assert.lengthOf(code.match(/console\.log/g), 2); +assert.lengthOf(__helpers.removeJSComments(code).match(/console\.log/g), 2); ``` You should log `character` to the console a second time. ```js -assert.lengthOf(code.match(/console\.log\(\s*character\s*\)/g), 2); +assert.lengthOf(__helpers.removeJSComments(code).match(/console\.log\(\s*character\s*\)/g), 2); ``` Your new `console.log()` should come after your reassignment. ```js -const reassign = code.split(/\n+/).findIndex(l => l.match(/character\s+=\s+("|')World\1/)); +const reassign = __helpers.removeJSComments(code).split(/\n+/).findIndex(l => l.match(/character\s+=\s+("|')World\1/)); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef55dd468079679ee0092.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef55dd468079679ee0092.md index e517f2ea106..d5ef2a6bcd5 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef55dd468079679ee0092.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef55dd468079679ee0092.md @@ -16,13 +16,13 @@ Also remove your `secondCharacter` variable, but leave the `character` initializ You should not have any `console.log()` statements in your code. ```js -assert.notMatch(code, /console/); +assert.notMatch(__helpers.removeJSComments(code), /console/); ``` You should not reassign the value of `character`. ```js -assert.isAtMost(code.match(/character/).length, 1); +assert.isAtMost(__helpers.removeJSComments(code).match(/character/).length, 1); ``` Your `character` variable should have the value `"Hello"`. @@ -34,7 +34,7 @@ assert.equal(character, "Hello"); You should not have a `secondCharacter` variable. ```js -assert.notMatch(code, /secondCharacter/); +assert.notMatch(__helpers.removeJSComments(code), /secondCharacter/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef5c1904955978a986a5c.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef5c1904955978a986a5c.md index e94906d74fb..11de2bdc226 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef5c1904955978a986a5c.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef5c1904955978a986a5c.md @@ -18,13 +18,13 @@ let money = 100; You should have a second `let` keyword in your code. ```js -assert.lengthOf(code.match(/let/g), 2); +assert.lengthOf(__helpers.removeJSComments(code).match(/let/g), 2); ``` You should use `let` to declare a `count` variable. ```js -assert.match(code, /let\s+count/); +assert.match(__helpers.removeJSComments(code), /let\s+count/); ``` You should assign the number `8` to your `count` variable. diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef6355e8f5a9e67fe5f46.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef6355e8f5a9e67fe5f46.md index 53f5f869147..4c372daaa04 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef6355e8f5a9e67fe5f46.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef6355e8f5a9e67fe5f46.md @@ -14,19 +14,19 @@ With the `number` data type, you can perform mathematical operations, like addit You should access the `console` in your code. ```js -assert.match(code, /console/); +assert.match(__helpers.removeJSComments(code), /console/); ``` You should access the `.log()` of the `console`. ```js -assert.match(code, /console\.log/); +assert.match(__helpers.removeJSComments(code), /console\.log/); ``` You should log `count + 1` to the console. ```js -assert.match(code, /console\.log\(\s*count\s*\+\s*1\s*\);?/); +assert.match(__helpers.removeJSComments(code), /console\.log\(\s*count\s*\+\s*1\s*\);?/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef857f2806aa626d29d17.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef857f2806aa626d29d17.md index 5a6b221288f..0924224c48e 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef857f2806aa626d29d17.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660ef857f2806aa626d29d17.md @@ -14,7 +14,7 @@ You can also perform subtraction (`-`), multiplication (`*`), and division (`/`) You should not have a `console.log()` in your code. ```js -assert.notMatch(code, /console/); +assert.notMatch(__helpers.removeJSComments(code), /console/); ``` Your `character` variable should still have the value `"Hello"`. diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f033cf051ebb50ea3bf48.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f033cf051ebb50ea3bf48.md index d98c76f9de8..55cc3234114 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f033cf051ebb50ea3bf48.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f033cf051ebb50ea3bf48.md @@ -24,13 +24,13 @@ Declare a `rows` variable and assign it an empty array. You should have a `rows` variable. ```js -assert.match(code, /rows/); +assert.match(__helpers.removeJSComments(code), /rows/); ``` You should use `let` to declare your `rows` variable. ```js -assert.match(code, /let\s+rows/); +assert.match(__helpers.removeJSComments(code), /let\s+rows/); ``` You should assign an empty array to your `rows` variable. diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f061d259bbebc37461080.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f061d259bbebc37461080.md index 12c26b252ed..a3eea2c73e8 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f061d259bbebc37461080.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f061d259bbebc37461080.md @@ -18,31 +18,31 @@ Use `console.log` and bracket notation to print the first value in your `rows` a You should have a `console.log()` statement in your code. ```js -assert.match(code, /console\.log/); +assert.match(__helpers.removeJSComments(code), /console\.log/); ``` You should access your `rows` array. ```js -assert.lengthOf(code.match(/rows/g), 2); +assert.lengthOf(__helpers.removeJSComments(code).match(/rows/g), 2); ``` You should use bracket notation with your `rows` array. ```js -assert.match(code, /rows\[/); +assert.match(__helpers.removeJSComments(code), /rows\[/); ``` You should use bracket notation to access the first element of your `rows` array. ```js -assert.match(code, /rows\[\s*0\s*\]/); +assert.match(__helpers.removeJSComments(code), /rows\[\s*0\s*\]/); ``` You should log the first element of your `rows` array. ```js -assert.match(code, /console\.log\(\s*rows\[\s*0\s*]\s*\);?/); +assert.match(__helpers.removeJSComments(code), /console\.log\(\s*rows\[\s*0\s*]\s*\);?/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f07d231941bc11719f664.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f07d231941bc11719f664.md index 1cf16efe991..e42ea925c62 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f07d231941bc11719f664.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f07d231941bc11719f664.md @@ -24,19 +24,19 @@ Update the **third** element of your `rows` array to be the number `10`. Then pr You should use bracket notation on the `rows` array again. ```js -assert.lengthOf(code.match(/rows\[/g), 2) +assert.lengthOf(__helpers.removeJSComments(code).match(/rows\[/g), 2) ``` You should access the third element of the `rows` array. ```js -assert.match(code, /rows\[\s*2\s*\]/); +assert.match(__helpers.removeJSComments(code), /rows\[\s*2\s*\]/); ``` You should use the assignment operator on the third element of the `rows` array. ```js -assert.match(code, /rows\[\s*2\s*\]\s*=/); +assert.match(__helpers.removeJSComments(code), /rows\[\s*2\s*\]\s*=/); ``` You should assign the value `10` to the third element of your `rows` array. @@ -48,13 +48,13 @@ assert.equal(rows[2], 10); You should have a second `console.log` statement in your code. ```js -assert.lengthOf(code.match(/console\.log/g), 2); +assert.lengthOf(__helpers.removeJSComments(code).match(/console\.log/g), 2); ``` You should log the `rows` array. ```js -assert.match(code, /console\.log\(\s*rows\s*\);?/); +assert.match(__helpers.removeJSComments(code), /console\.log\(\s*rows\s*\);?/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f09a2694b59c3a10ee304.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f09a2694b59c3a10ee304.md index 25ceec5f533..ba10671d2c2 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f09a2694b59c3a10ee304.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f09a2694b59c3a10ee304.md @@ -14,19 +14,19 @@ For now, remove your first console log and your `rows[rows.length - 1]` assignme You should remove your `console.log(rows[0])` statement. ```js -assert.notMatch(code, /console\.log\(\s*rows\[\s*0\s*\]\s*\)/); +assert.notMatch(__helpers.removeJSComments(code), /console\.log\(\s*rows\[\s*0\s*\]\s*\)/); ``` You should remove your `rows[rows.length - 1]` reassignment. ```js -assert.notMatch(code, /rows\[\s*rows\.length\s*-\s*1\s*\]/); +assert.notMatch(__helpers.removeJSComments(code), /rows\[\s*rows\.length\s*-\s*1\s*\]/); ``` You should not remove your `console.log(rows)` statement. ```js -assert.match(code, /console\.log\(\s*rows\s*\);/); +assert.match(__helpers.removeJSComments(code), /console\.log\(\s*rows\s*\);/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0a55847d6cc485f29ba5.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0a55847d6cc485f29ba5.md index dc6e18aca5d..ced0c151ce2 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0a55847d6cc485f29ba5.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0a55847d6cc485f29ba5.md @@ -22,19 +22,19 @@ Use `.push()` to add the string `"freeCodeCamp"` to the end of your `rows` array You should use `.push()` in your code. ```js -assert.match(code, /\.push\(/); +assert.match(__helpers.removeJSComments(code), /\.push\(/); ``` You should use the `.push()` method of your `rows` array. ```js -assert.match(code, /rows\.push\(/); +assert.match(__helpers.removeJSComments(code), /rows\.push\(/); ``` You should pass the string `"freeCodeCamp"` to your `.push()` method. ```js -assert.match(code, /rows\.push\(\s*('|")freeCodeCamp\1\s*\);?/) +assert.match(__helpers.removeJSComments(code), /rows\.push\(\s*('|")freeCodeCamp\1\s*\);?/) ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0c34aad72dc712b97624.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0c34aad72dc712b97624.md index 6d40acd2eb8..202842326a4 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0c34aad72dc712b97624.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0c34aad72dc712b97624.md @@ -18,31 +18,31 @@ Create a new variable called `popped` and assign it the result of `rows.pop()`. You should declare a variable called `popped`. ```js -assert.match(code, /popped/); +assert.match(__helpers.removeJSComments(code), /popped/); ``` You should use `let` to declare your variable called `popped`. ```js -assert.match(code, /let\s+popped/); +assert.match(__helpers.removeJSComments(code), /let\s+popped/); ``` You should call the `.pop()` method. ```js -assert.match(code, /\.pop\(\s*\)/); +assert.match(__helpers.removeJSComments(code), /\.pop\(\s*\)/); ``` You should call the `.pop()` method on your `rows` array. ```js -assert.match(code, /rows\.pop\(\s*\)/); +assert.match(__helpers.removeJSComments(code), /rows\.pop\(\s*\)/); ``` You should log your `popped` variable. ```js -assert.match(code, /console\.log\(\s*popped\s*\)/); +assert.match(__helpers.removeJSComments(code), /console\.log\(\s*popped\s*\)/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0da9bf1035c9097af20a.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0da9bf1035c9097af20a.md index c3048b7527d..17183fd9ec0 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0da9bf1035c9097af20a.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0da9bf1035c9097af20a.md @@ -16,13 +16,13 @@ But what does `.push()` return? Assign your existing `rows.push()` to a new `pus You should declare a `pushed` variable. ```js -assert.match(code, /pushed/); +assert.match(__helpers.removeJSComments(code), /pushed/); ``` You should use `let` to declare your `pushed` variable. ```js -assert.match(code, /let\s+pushed/); +assert.match(__helpers.removeJSComments(code), /let\s+pushed/); ``` You should assign `rows.push("freeCodeCamp")` to your `pushed` variable. @@ -34,7 +34,7 @@ assert.equal(pushed, 4); You should log your `pushed` variable. ```js -assert.match(code, /console\.log\(\s*pushed\s*\)/); +assert.match(__helpers.removeJSComments(code), /console\.log\(\s*pushed\s*\)/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0ee51d7460ce88cd248d.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0ee51d7460ce88cd248d.md index f97a27ad27e..87a651b8a51 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0ee51d7460ce88cd248d.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0ee51d7460ce88cd248d.md @@ -16,31 +16,31 @@ It is important to be aware of what values a method returns. Take some time to e You should not have a `.push()` call. ```js -assert.notMatch(code, /\.push\(/); +assert.notMatch(__helpers.removeJSComments(code), /\.push\(/); ``` You should not have a `.pop()` call. ```js -assert.notMatch(code, /.pull\(/); +assert.notMatch(__helpers.removeJSComments(code), /.pull\(/); ``` You should not have any log statements. ```js -assert.notMatch(code, /console\.log/); +assert.notMatch(__helpers.removeJSComments(code), /console\.log/); ``` You should not have a `popped` variable. ```js -assert.notMatch(code, /popped/); +assert.notMatch(__helpers.removeJSComments(code), /popped/); ``` You should not have a `pushed` variable. ```js -assert.notMatch(code, /pushed/); +assert.notMatch(__helpers.removeJSComments(code), /pushed/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0f980e98e8cf77f1ce31.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0f980e98e8cf77f1ce31.md index a0366d3e76e..5dfa1ad99c2 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0f980e98e8cf77f1ce31.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f0f980e98e8cf77f1ce31.md @@ -22,7 +22,7 @@ assert.empty(rows); Your `"Hello"` string should use double quotes. ```js -assert.match(code, /"Hello"/); +assert.match(__helpers.removeJSComments(code), /"Hello"/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f165270622fd4ec0da3f7.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f165270622fd4ec0da3f7.md index 0a27b0d2c62..0a7700c4bfa 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f165270622fd4ec0da3f7.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f165270622fd4ec0da3f7.md @@ -31,25 +31,25 @@ Replace your `let` keywords with `const`. You should use `const` to declare your `character` variable. ```js -assert.match(code, /const\s+character/); +assert.match(__helpers.removeJSComments(code), /const\s+character/); ``` You should use `const` to declare your `count` variable. ```js -assert.match(code, /const\s+count/); +assert.match(__helpers.removeJSComments(code), /const\s+count/); ``` You should use `const` to declare your `rows` variable. ```js -assert.match(code, /const\s+rows/); +assert.match(__helpers.removeJSComments(code), /const\s+rows/); ``` You should not use `let` in your code. ```js -assert.notMatch(code, /let/); +assert.notMatch(__helpers.removeJSComments(code), /let/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f17d4e9f227d86e834abd.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f17d4e9f227d86e834abd.md index a071ceb7db5..0f261d799f5 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f17d4e9f227d86e834abd.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f17d4e9f227d86e834abd.md @@ -25,31 +25,31 @@ In the upcoming steps, you'll explore each component of a loop in detail. For no You should have a `for` loop. ```js -assert.match(code, /for/); +assert.match(__helpers.removeJSComments(code), /for/); ``` The first component of your `for` loop should be the string `"iterator"`. ```js -assert.match(code, /for\s*\(\s*('|")iterator\1/); +assert.match(__helpers.removeJSComments(code), /for\s*\(\s*('|")iterator\1/); ``` The second component of your `for` loop should be the string `"condition"`. ```js -assert.match(code, /for\s*\(\s*('|")iterator\1\s*;\s*('|")condition\2/); +assert.match(__helpers.removeJSComments(code), /for\s*\(\s*('|")iterator\1\s*;\s*('|")condition\2/); ``` The third component of your `for` loop should be the string `"iteration"`. ```js -assert.match(code, /for\s*\(\s*('|")iterator\1\s*;\s*('|")condition\2\s*;\s*('|")iteration\3\s*\)/); +assert.match(__helpers.removeJSComments(code), /for\s*\(\s*('|")iterator\1\s*;\s*('|")condition\2\s*;\s*('|")iteration\3\s*\)/); ``` The body of your `for` loop should be empty. ```js -assert.match(code, /for\s*\(\s*('|")iterator\1\s*;\s*('|")condition\2\s*;\s*('|")iteration\3\s*\)\s*\{\s*\}/); +assert.match(__helpers.removeJSComments(code), /for\s*\(\s*('|")iterator\1\s*;\s*('|")condition\2\s*;\s*('|")iteration\3\s*\)\s*\{\s*\}/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f18f059fe0fda192ce394.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f18f059fe0fda192ce394.md index 68bbc22d33e..4f08eaeb3b4 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f18f059fe0fda192ce394.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f18f059fe0fda192ce394.md @@ -24,19 +24,19 @@ Replace the string `"iterator"` with a `let` declaration for the variable `i`. A You should use `let` to declare an `i` variable. ```js -assert.match(code, /let\s+i/); +assert.match(__helpers.removeJSComments(code), /let\s+i/); ``` You should assign `0` to your `i` variable. ```js -assert.match(code, /let\s+i\s*=\s*0/); +assert.match(__helpers.removeJSComments(code), /let\s+i\s*=\s*0/); ``` Your `for` loop should start an `i` iterator at `0`. ```js -assert.match(code, /for\s*\(\s*let\s+i\s*=\s*0/); +assert.match(__helpers.removeJSComments(code), /for\s*\(\s*let\s+i\s*=\s*0/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f1a00ac619ddc1e259a66.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f1a00ac619ddc1e259a66.md index b3262dda7d7..8083b983258 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f1a00ac619ddc1e259a66.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f1a00ac619ddc1e259a66.md @@ -20,19 +20,19 @@ Replace your `"condition"` string with a condition to check if `i` is less than You should use the less than operator. ```js -assert.match(code, /\s*0\s*;\s*false\s*\)/); +assert.match(__helpers.removeJSComments(code), /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*false\s*\)/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4ae5b3924c3fc3373973.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4ae5b3924c3fc3373973.md index c4ae6ced481..496ef94d498 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4ae5b3924c3fc3373973.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4ae5b3924c3fc3373973.md @@ -16,7 +16,7 @@ Like you did earlier with `i = i + 1`, update your iteration statement to give ` Your `for` loop should use `i = i - 1` as the iteration. ```js -assert.match(code, /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i\s*=\s*i\s*-\s*1\s*\)/); +assert.match(__helpers.removeJSComments(code), /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i\s*=\s*i\s*-\s*1\s*\)/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4b33e2a3364094ecb540.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4b33e2a3364094ecb540.md index 586682abc0b..1be6ae40843 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4b33e2a3364094ecb540.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4b33e2a3364094ecb540.md @@ -16,25 +16,25 @@ Open up the console to see the upside-down pyramid. Your `for` loop should call `rows.push()`. ```js -assert.match(code, /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i\s*=\s*i\s*-\s*1\s*\)\s*\{\s*rows\.push\(/); +assert.match(__helpers.removeJSComments(code), /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i\s*=\s*i\s*-\s*1\s*\)\s*\{\s*rows\.push\(/); ``` You should call `padRow()` in your `.push()` call. ```js -assert.match(code, /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i\s*=\s*i\s*-\s*1\s*\)\s*\{\s*rows\.push\(\s*padRow\s*\(/); +assert.match(__helpers.removeJSComments(code), /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i\s*=\s*i\s*-\s*1\s*\)\s*\{\s*rows\.push\(\s*padRow\s*\(/); ``` You should pass `i` as the first argument to your `padRow()` call. ```js -assert.match(code, /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i\s*=\s*i\s*-\s*1\s*\)\s*\{\s*rows\.push\(\s*padRow\s*\(\s*i/); +assert.match(__helpers.removeJSComments(code), /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i\s*=\s*i\s*-\s*1\s*\)\s*\{\s*rows\.push\(\s*padRow\s*\(\s*i/); ``` You should pass `count` as the second argument to your `padRow()` call. ```js -assert.match(code, /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i\s*=\s*i\s*-\s*1\s*\)\s*\{\s*rows\.push\(\s*padRow\s*\(\s*i\s*,\s*count\s*\)\s*\)/); +assert.match(__helpers.removeJSComments(code), /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i\s*=\s*i\s*-\s*1\s*\)\s*\{\s*rows\.push\(\s*padRow\s*\(\s*i\s*,\s*count\s*\)\s*\)/); ``` diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4b641290da41b2cf0dd9.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4b641290da41b2cf0dd9.md index 0f0c8523653..321f9591f3e 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4b641290da41b2cf0dd9.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4b641290da41b2cf0dd9.md @@ -16,13 +16,13 @@ Replace your iterator statement with the correct statement using the subtraction Your `for` loop should not use `i = i - 1`. ```js -assert.notMatch(code, /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i\s*=\s*i\s*-\s*1\s*\)\s*\{\s*rows\.push\(\s*padRow\s*\(\s*i\s*,\s*count\s*\)\s*\);/); +assert.notMatch(__helpers.removeJSComments(code), /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i\s*=\s*i\s*-\s*1\s*\)\s*\{\s*rows\.push\(\s*padRow\s*\(\s*i\s*,\s*count\s*\)\s*\);/); ``` Your `for` loop should use subtraction assignment to reduce `i` by `1`. ```js -assert.match(code, /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i\s*-=\s*1\s*\)\s*\{\s*rows\.push\(\s*padRow\s*\(\s*i\s*,\s*count\s*\)\s*\);/); +assert.match(__helpers.removeJSComments(code), /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i\s*-=\s*1\s*\)\s*\{\s*rows\.push\(\s*padRow\s*\(\s*i\s*,\s*count\s*\)\s*\);/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4c3b01c44743719c99e4.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4c3b01c44743719c99e4.md index 752b112adda..0a851d18e5d 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4c3b01c44743719c99e4.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4c3b01c44743719c99e4.md @@ -16,13 +16,13 @@ Replace your subtraction assignment with the decrement operator. Your `for` loop should not use subtraction assignment. ```js -assert.notMatch(code, /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i\s*-=\s*1\s*\)\s*\{\s*rows\.push\(\s*padRow\s*\(\s*i\s*,\s*count\s*\)\s*\);/); +assert.notMatch(__helpers.removeJSComments(code), /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i\s*-=\s*1\s*\)\s*\{\s*rows\.push\(\s*padRow\s*\(\s*i\s*,\s*count\s*\)\s*\);/); ``` Your `for` loop should use the decrement operator. ```js -assert.match(code, /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i--\s*\)\s*\{\s*rows\.push\(\s*padRow\s*\(\s*i\s*,\s*count\s*\)\s*\);/); +assert.match(__helpers.removeJSComments(code), /for\s*\(\s*let\s*i\s*=\s*count\s*;\s*i\s*>\s*0\s*;\s*i--\s*\)\s*\{\s*rows\.push\(\s*padRow\s*\(\s*i\s*,\s*count\s*\)\s*\);/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4cffb1459d45e34902d1.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4cffb1459d45e34902d1.md index 0e63c6943b1..724ea5c85ad 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4cffb1459d45e34902d1.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4cffb1459d45e34902d1.md @@ -16,7 +16,7 @@ To do this, you'll need to learn a couple of new array methods. Start by using ` You should use `const` to declare a `numbers` variable. ```js -assert.match(code, /const\s+numbers/); +assert.match(__helpers.removeJSComments(code), /const\s+numbers/); ``` Your `numbers` variable should be an array. @@ -34,7 +34,7 @@ assert.deepEqual(numbers, [1,2,3]); You should log your `numbers` array. ```js -assert.match(code, /console\.log\(\s*numbers\s*\);?/); +assert.match(__helpers.removeJSComments(code), /console\.log\(\s*numbers\s*\);?/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4de78f775e480ba2e451.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4de78f775e480ba2e451.md index 10c45db3bef..e4b22a08204 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4de78f775e480ba2e451.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4de78f775e480ba2e451.md @@ -23,13 +23,13 @@ Use `const` to declare an `unshifted` variable, and assign it the result of call You should declare your `unshifted` variable. ```js -assert.match(code, /const\s+unshifted/); +assert.match(__helpers.removeJSComments(code), /const\s+unshifted/); ``` You should call the `.unshift()` method on your `numbers` array. ```js -assert.match(code, /numbers\.unshift\(/); +assert.match(__helpers.removeJSComments(code), /numbers\.unshift\(/); ``` You should pass `5` as the argument to your `.unshift()` call. diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4e74f7fd3f4a99ac2e50.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4e74f7fd3f4a99ac2e50.md index 97b59e6040a..8528832a8dc 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4e74f7fd3f4a99ac2e50.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4e74f7fd3f4a99ac2e50.md @@ -25,7 +25,7 @@ Directly below your `numbers` array, declare a `shifted` variable and assign it You should use `const` to declare a `shifted` variable. ```js -assert.match(code, /const\s+shifted/); +assert.match(__helpers.removeJSComments(code), /const\s+shifted/); ``` You should call `.shift()` on your `numbers` array. @@ -43,7 +43,7 @@ assert.equal(shifted, 1); You should log your `shifted` variable. ```js -assert.match(code, /console\.log\(\s*shifted\s*\)/); +assert.match(__helpers.removeJSComments(code), /console\.log\(\s*shifted\s*\)/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4efcb8068e4cb470dca1.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4efcb8068e4cb470dca1.md index 0900c7ef420..3aa24d515f7 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4efcb8068e4cb470dca1.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f4efcb8068e4cb470dca1.md @@ -16,25 +16,25 @@ Remove your `numbers` array, and the method calls and log calls. You should not have a `numbers` array. ```js -assert.notMatch(code, /numbers/); +assert.notMatch(__helpers.removeJSComments(code), /numbers/); ``` You should not have an `unshifted` variable. ```js -assert.notMatch(code, /unshifted/); +assert.notMatch(__helpers.removeJSComments(code), /unshifted/); ``` You should not have a `shifted` variable. ```js -assert.notMatch(code, /shifted/); +assert.notMatch(__helpers.removeJSComments(code), /shifted/); ``` You should not have your `console.log` statements. ```js -assert.lengthOf(code.match(/console\.log/g), 1); +assert.lengthOf(__helpers.removeJSComments(code).match(/console\.log/g), 1); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f505d02b2bd513a1c3468.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f505d02b2bd513a1c3468.md index d13d573c0dd..def7bbf1647 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f505d02b2bd513a1c3468.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f505d02b2bd513a1c3468.md @@ -23,19 +23,19 @@ assert.match(stripped, /\.unshift/); You should pass a `padRow()` call as the argument for your `.unshift()` method. ```js -assert.match(code, /rows\.unshift\(\s*padRow\(/); +assert.match(__helpers.removeJSComments(code), /rows\.unshift\(\s*padRow\(/); ``` You should pass `i` as the first argument to your `padRow()` call. ```js -assert.match(code, /rows\.unshift\(\s*padRow\(\s*i/) +assert.match(__helpers.removeJSComments(code), /rows\.unshift\(\s*padRow\(\s*i/) ``` You should pass `count` as the second argument to your `padRow()` call. ```js -assert.match(code, /rows\.unshift\(\s*padRow\(\s*i\s*,\s*count\s*\)/); +assert.match(__helpers.removeJSComments(code), /rows\.unshift\(\s*padRow\(\s*i\s*,\s*count\s*\)/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f50a21fe7645252804f2b.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f50a21fe7645252804f2b.md index 3599c8a9ec7..620f12a3f6e 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f50a21fe7645252804f2b.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f50a21fe7645252804f2b.md @@ -16,13 +16,13 @@ Start by declaring an `inverted` variable, and assigning it the value `true`. Yo You should declare an `inverted` variable with `let`. ```js -assert.match(code, /let\s+inverted/); +assert.match(__helpers.removeJSComments(code), /let\s+inverted/); ``` You should initialise `inverted` with the value `true`. ```js -assert.match(code, /let\s+inverted\s*=\s*true;?/); +assert.match(__helpers.removeJSComments(code), /let\s+inverted\s*=\s*true;?/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f5179b3b0ca558f6b4d4f.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f5179b3b0ca558f6b4d4f.md index 69290bc29c5..6fde1da3ac7 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f5179b3b0ca558f6b4d4f.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f5179b3b0ca558f6b4d4f.md @@ -14,19 +14,19 @@ Use an `if` statement to check if `inverted` is true. Remember that you do not n You should use an `if` statement. ```js -assert.match(code, /if\s*\(/); +assert.match(__helpers.removeJSComments(code), /if\s*\(/); ``` Your `if` statement should check if `inverted` is `true`. ```js -assert.match(code, /if\s*\(\s*inverted/); +assert.match(__helpers.removeJSComments(code), /if\s*\(\s*inverted/); ``` Your `if` condition should not use any comparison operators. ```js -assert.match(code, /if\s*\(\s*inverted\s*\)/); +assert.match(__helpers.removeJSComments(code), /if\s*\(\s*inverted\s*\)/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f51f1df0a8757934a5796.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f51f1df0a8757934a5796.md index 1819adece5a..0187e2dd750 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f51f1df0a8757934a5796.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f51f1df0a8757934a5796.md @@ -14,7 +14,7 @@ Now move your `.unshift()` call into your `if` block. Your `.unshift()` call should be in your `if` block. ```js -assert.match(code, /if\s*\(\s*inverted\s*\)\s*\{\s*rows\.unshift\(\s*padRow\(\s*i\s*,\s*count\s*\)\s*\);\s*\}/); +assert.match(__helpers.removeJSComments(code), /if\s*\(\s*inverted\s*\)\s*\{\s*rows\.unshift\(\s*padRow\(\s*i\s*,\s*count\s*\)\s*\);\s*\}/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f530d6e33d159e1bf4947.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f530d6e33d159e1bf4947.md index ca2941fdaa4..bc788ec4e02 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f530d6e33d159e1bf4947.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f530d6e33d159e1bf4947.md @@ -26,13 +26,13 @@ Add an `else` block to your `if` block. You should add an `else` block. ```js -assert.match(code, /if\s*\(\s*inverted\s*\)\s*\{\s*rows\.unshift\(\s*padRow\(\s*i\s*,\s*count\s*\)\s*\);\s*\}\s*else\s*\{/); +assert.match(__helpers.removeJSComments(code), /if\s*\(\s*inverted\s*\)\s*\{\s*rows\.unshift\(\s*padRow\(\s*i\s*,\s*count\s*\)\s*\);\s*\}\s*else\s*\{/); ``` Your `else` block should be empty. ```js -assert.match(code, /if\s*\(\s*inverted\s*\)\s*\{\s*rows\.unshift\(\s*padRow\(\s*i\s*,\s*count\s*\)\s*\);\s*\}\s*else\s*\{\s*\}/); +assert.match(__helpers.removeJSComments(code), /if\s*\(\s*inverted\s*\)\s*\{\s*rows\.unshift\(\s*padRow\(\s*i\s*,\s*count\s*\)\s*\);\s*\}\s*else\s*\{\s*\}/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f535ec33a285b33af3774.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f535ec33a285b33af3774.md index 539bfaf2d6f..a5a7ed2ab57 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f535ec33a285b33af3774.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f535ec33a285b33af3774.md @@ -14,25 +14,25 @@ When `inverted` is false, you want to build a standard pyramid. Use `.push()` li You should call the `.push()` method of `rows` in your `else` block. ```js -assert.match(code, /if\s*\(\s*inverted\s*\)\s*\{\s*rows\.unshift\(\s*padRow\(\s*i\s*,\s*count\s*\)\s*\);\s*\}\s*else\s*\{\s*rows\.push\(\s*/); +assert.match(__helpers.removeJSComments(code), /if\s*\(\s*inverted\s*\)\s*\{\s*rows\.unshift\(\s*padRow\(\s*i\s*,\s*count\s*\)\s*\);\s*\}\s*else\s*\{\s*rows\.push\(\s*/); ``` You should pass a `padRow()` call as the argument for your `.unshift()` method. ```js -assert.match(code, /if\s*\(\s*inverted\s*\)\s*\{\s*rows\.unshift\(\s*padRow\(\s*i\s*,\s*count\s*\)\s*\);\s*\}\s*else\s*\{\s*rows\.push\(\s*padRow\(/); +assert.match(__helpers.removeJSComments(code), /if\s*\(\s*inverted\s*\)\s*\{\s*rows\.unshift\(\s*padRow\(\s*i\s*,\s*count\s*\)\s*\);\s*\}\s*else\s*\{\s*rows\.push\(\s*padRow\(/); ``` You should pass `i` as the first argument to your `padRow()` call. ```js -assert.match(code, /if\s*\(\s*inverted\s*\)\s*\{\s*rows\.unshift\(\s*padRow\(\s*i\s*,\s*count\s*\)\s*\);\s*\}\s*else\s*\{\s*rows\.push\(\s*padRow\(\s*i/); +assert.match(__helpers.removeJSComments(code), /if\s*\(\s*inverted\s*\)\s*\{\s*rows\.unshift\(\s*padRow\(\s*i\s*,\s*count\s*\)\s*\);\s*\}\s*else\s*\{\s*rows\.push\(\s*padRow\(\s*i/); ``` You should pass `count` as the second argument to your `padRow()` call. ```js -assert.match(code, /if\s*\(\s*inverted\s*\)\s*\{\s*rows\.unshift\(\s*padRow\(\s*i\s*,\s*count\s*\)\s*\);\s*\}\s*else\s*\{\s*rows\.push\(\s*padRow\(\s*i\s*,\s*count\s*\)/); +assert.match(__helpers.removeJSComments(code), /if\s*\(\s*inverted\s*\)\s*\{\s*rows\.unshift\(\s*padRow\(\s*i\s*,\s*count\s*\)\s*\);\s*\}\s*else\s*\{\s*rows\.push\(\s*padRow\(\s*i\s*,\s*count\s*\)/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f53ad3d39175c5d4335ac.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f53ad3d39175c5d4335ac.md index eaa89931561..bf2bdf0b6e3 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f53ad3d39175c5d4335ac.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/660f53ad3d39175c5d4335ac.md @@ -16,13 +16,13 @@ Remove all comments, both single- and multi-line, from your code. You should not have any single-line comments in your code. ```js -assert.notMatch(code, /\/\//); +assert.notMatch(__helpers.removeJSComments(code), /\/\//); ``` You should not have any multi-line comments in your code. ```js -assert.notMatch(code, /(?:\\\*|\/\*)/); +assert.notMatch(__helpers.removeJSComments(code), /(?:\\\*|\/\*)/); ``` You should not have any comments in your code. diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610b741b54b90f0c0fb3d58.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610b741b54b90f0c0fb3d58.md index 7b352952215..5993cff1448 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610b741b54b90f0c0fb3d58.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610b741b54b90f0c0fb3d58.md @@ -25,19 +25,19 @@ Use camel case to declare a new `secondCharacter` variable. You should declare a `secondCharacter` variable. ```js -assert.match(code, /secondCharacter/); +assert.match(__helpers.removeJSComments(code), /secondCharacter/); ``` You should use `let` to declare your `secondCharacter` variable. ```js -assert.match(code, /let\s+secondCharacter/); +assert.match(__helpers.removeJSComments(code), /let\s+secondCharacter/); ``` You should not assign a value to your `secondCharacter` variable. Do not forget your semi-colon. ```js -assert.match(code, /let\s+secondCharacter;/); +assert.match(__helpers.removeJSComments(code), /let\s+secondCharacter;/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610b8017d1671f2814e8c77.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610b8017d1671f2814e8c77.md index 69250664a4e..2f401b07826 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610b8017d1671f2814e8c77.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610b8017d1671f2814e8c77.md @@ -16,13 +16,13 @@ Add a `console.log()` to see what the value of your `secondCharacter` variable i You should add a second `console.log`. ```js -assert.lengthOf(code.match(/console\.log/g), 2); +assert.lengthOf(__helpers.removeJSComments(code).match(/console\.log/g), 2); ``` You should log your `secondCharacter` variable. ```js -assert.match(code, /console\.log\(\s*secondCharacter\s*\)/); +assert.match(__helpers.removeJSComments(code), /console\.log\(\s*secondCharacter\s*\)/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610b8f6a98d25f4d485a94d.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610b8f6a98d25f4d485a94d.md index d5bb49f25d3..c583b653f07 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610b8f6a98d25f4d485a94d.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610b8f6a98d25f4d485a94d.md @@ -23,13 +23,13 @@ Assign the string `"Test"` to your `secondCharacter` variable below your declara You should not initialize `secondCharacter`. Remember that initialization means assigning a value when you declare the variable. ```js -assert.notMatch(code, /let\s+secondCharacter\s*=/); +assert.notMatch(__helpers.removeJSComments(code), /let\s+secondCharacter\s*=/); ``` You should use the assignment operator on `secondCharacter`. ```js -assert.match(code, /secondCharacter\s*=/); +assert.match(__helpers.removeJSComments(code), /secondCharacter\s*=/); ``` You should assign the string `"Test"` to your `secondCharacter` variable. diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610b9f7619764fad5fd516d.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610b9f7619764fad5fd516d.md index 588c6b0a014..ff688b31dbd 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610b9f7619764fad5fd516d.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610b9f7619764fad5fd516d.md @@ -32,7 +32,7 @@ assert.notEqual(secondCharacter, "Test"); You should assign the value of the `character` variable to your `secondCharacter` variable. Don't forget your semi-colon. ```js -assert.match(code, /secondCharacter\s*=\s*character;/); +assert.match(__helpers.removeJSComments(code), /secondCharacter\s*=\s*character;/); ``` Your `secondCharacter` variable should now have the value `"World"`. diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610bbed59bc2a0194d85533.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610bbed59bc2a0194d85533.md index 0889f194dc1..fcb3e6ff7a4 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610bbed59bc2a0194d85533.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610bbed59bc2a0194d85533.md @@ -28,19 +28,19 @@ You should not see anything change in your console. You should use the `.length` property of your `rows` array. ```js -assert.match(code, /rows\.length/); +assert.match(__helpers.removeJSComments(code), /rows\.length/); ``` You should use `rows.length` in your bracket notation. ```js -assert.match(code, /rows\[\s*rows\.length/); +assert.match(__helpers.removeJSComments(code), /rows\[\s*rows\.length/); ``` You should subtract `1` from the length in your bracket notation. ```js -assert.match(code, /rows\[\s*rows\.length\s*-\s*1\s*\]/) +assert.match(__helpers.removeJSComments(code), /rows\[\s*rows\.length\s*-\s*1\s*\]/) ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610bf6fa14d700beed1b109.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610bf6fa14d700beed1b109.md index 99b615e6568..531dc854f63 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610bf6fa14d700beed1b109.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610bf6fa14d700beed1b109.md @@ -16,13 +16,13 @@ Add an `if` statement to your loop. The statement should check if `done` is equa You should use an `if` statement in your loop. ```js -assert.match(code, /while\s*\(\s*continueLoop\s*\)\s*\{\s*done\+\+;\s*if/); +assert.match(__helpers.removeJSComments(code), /while\s*\(\s*continueLoop\s*\)\s*\{\s*done\+\+;\s*if/); ``` Your `if` statement should use the equality operator to compare `done` and `count` in the condition. ```js -assert.match(code, /while\s*\(\s*continueLoop\s*\)\s*\{\s*done\+\+;\s*if\s*\(\s*(?:done\s*==\s*count|count\s*==\s*done)\s*\)\s*\{/); +assert.match(__helpers.removeJSComments(code), /while\s*\(\s*continueLoop\s*\)\s*\{\s*done\+\+;\s*if\s*\(\s*(?:done\s*==\s*count|count\s*==\s*done)\s*\)\s*\{/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c105bbdacc114d6cdc44.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c105bbdacc114d6cdc44.md index 9915664685c..87e6b0052c9 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c105bbdacc114d6cdc44.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c105bbdacc114d6cdc44.md @@ -23,7 +23,7 @@ Call your `padRow` function. You should call the `padRow` function. ```js -assert.lengthOf(code.match(/padRow\(\)/g), 2); +assert.lengthOf(__helpers.removeJSComments(code).match(/padRow\(\)/g), 2); ``` Your `padRow` function body should be empty. diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c16c4fa0df12c0e30675.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c16c4fa0df12c0e30675.md index cde3b184a9d..614974ff5c4 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c16c4fa0df12c0e30675.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c16c4fa0df12c0e30675.md @@ -16,19 +16,19 @@ To see the result of calling your `padRow` function, declare a `call` variable a You should declare a `call` variable. ```js -assert.match(code, /(const|let)\s+call/); +assert.match(__helpers.removeJSComments(code), /(const|let)\s+call/); ``` You should use `const` to declare your `call` variable. ```js -assert.match(code, /const\s+call/); +assert.match(__helpers.removeJSComments(code), /const\s+call/); ``` You should assign `call` the result of your `padRow` call. ```js -assert.match(code, /const\s+call\s*=\s*padRow\(\)/); +assert.match(__helpers.removeJSComments(code), /const\s+call\s*=\s*padRow\(\)/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c1d97b1671140f95cfbb.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c1d97b1671140f95cfbb.md index 2f25a57649f..be94bcae855 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c1d97b1671140f95cfbb.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c1d97b1671140f95cfbb.md @@ -14,13 +14,13 @@ Now add a log statement to print the value of your `call` variable. You should add a `console.log` call. ```js -assert.lengthOf(code.match(/console\.log/g), 2) +assert.lengthOf(__helpers.removeJSComments(code).match(/console\.log/g), 2) ``` You should log your `call` variable. Don't forget the semi-colon. ```js -assert.match(code, /console\.log\(\s*call\s*\);/); +assert.match(__helpers.removeJSComments(code), /console\.log\(\s*call\s*\);/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c48c4ea0891afa7c4696.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c48c4ea0891afa7c4696.md index 69c3acf938b..46d8c1f566f 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c48c4ea0891afa7c4696.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c48c4ea0891afa7c4696.md @@ -25,7 +25,7 @@ Pass your own name as the argument for the `name` parameter in your `padRow` cal You should pass a string to your `padRow()` call. ```js -assert.match(code, /padRow\(\s*("|').+\1\s*\)/); +assert.match(__helpers.removeJSComments(code), /padRow\(\s*("|').+\1\s*\)/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c83b52583e245a079217.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c83b52583e245a079217.md index 66cd0c0bf08..56c2efc42ff 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c83b52583e245a079217.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c83b52583e245a079217.md @@ -23,13 +23,13 @@ assert.notMatch(padRow.toString(), /name/); You should not pass `"CamperChan"` to your `padRow` call. ```js -assert.notMatch(code, /CamperChan/); +assert.notMatch(__helpers.removeJSComments(code), /CamperChan/); ``` You should still call your `padRow` function. ```js -assert.lengthOf(code.match(/padRow\(\)/g), 2); +assert.lengthOf(__helpers.removeJSComments(code).match(/padRow\(\)/g), 2); ``` You should not have a `console.log` before your `return` keyword. diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c8cfe4cf4d278e35c156.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c8cfe4cf4d278e35c156.md index 14750c6ff5b..9a22864168d 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c8cfe4cf4d278e35c156.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/6610c8cfe4cf4d278e35c156.md @@ -14,13 +14,13 @@ As expected, your function now returns `undefined` again. Your `call` variable i You should not have a `call` declaration. ```js -assert.notMatch(code, /const\s*call/); +assert.notMatch(__helpers.removeJSComments(code), /const\s*call/); ``` You should not log your `call` variable. ```js -assert.notMatch(code, /call/); +assert.notMatch(__helpers.removeJSComments(code), /call/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/661483051820c3c1ab4595e0.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/661483051820c3c1ab4595e0.md index b0de1fc253f..533b4595f3a 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/661483051820c3c1ab4595e0.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/661483051820c3c1ab4595e0.md @@ -20,13 +20,13 @@ You'll need to change the `while` condition to use the less than operator, inste You should pass `rows.length + 1` as the first argument to your `padRow` call. ```js -assert.match(code, /rows\.push\(padRow\s*\(\s*rows\.length\s*\+\s*1/); +assert.match(__helpers.removeJSComments(code), /rows\.push\(padRow\s*\(\s*rows\.length\s*\+\s*1/); ``` Your `while` loop should run while `rows.length` is less than `count`. ```js -assert.match(code, /while\s*\(\s*rows\.length\s*<\s*count\)/); +assert.match(__helpers.removeJSComments(code), /while\s*\(\s*rows\.length\s*<\s*count\)/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/66458f0a05df478aa627629e.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/66458f0a05df478aa627629e.md index 0ce9eee9b58..0a2da3de1a8 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/66458f0a05df478aa627629e.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/66458f0a05df478aa627629e.md @@ -34,19 +34,19 @@ Check the console to see the results. You should have an `else if` statement. ```js -assert.match(code, /else\s+if\s*\(/); +assert.match(__helpers.removeJSComments(code), /else\s+if\s*\(/); ``` Your `else if` statement should check if `5` is less than `10`. ```js -assert.match(code, /else\s+if\s*\(\s*5\s*<\s*10\s*\)/); +assert.match(__helpers.removeJSComments(code), /else\s+if\s*\(\s*5\s*<\s*10\s*\)/); ``` You should log the string `"5 is less than 10"` to the console. ```js -assert.match(code, /console\.log\(\s*('|"|`)5\s+is\s+less\s+than\s+10\1\s*\)/); +assert.match(__helpers.removeJSComments(code), /console\.log\(\s*('|"|`)5\s+is\s+less\s+than\s+10\1\s*\)/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/664599653fcd6e97104f9261.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/664599653fcd6e97104f9261.md index 7c8fddf7b60..2e291529553 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/664599653fcd6e97104f9261.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/664599653fcd6e97104f9261.md @@ -34,13 +34,13 @@ To see the results in the console, you can manually change the `<` in the `else You should have an `else` block. ```js -assert.match(code, /else\s*\{/); +assert.match(__helpers.removeJSComments(code), /else\s*\{/); ``` Your `else` block should log the string `"This is the else block"` to the console. ```js -assert.match(code, /console\.log\(\s*('|"|`)This\s+is\s+the\s+else\s+block\1\s*\)/); +assert.match(__helpers.removeJSComments(code), /console\.log\(\s*('|"|`)This\s+is\s+the\s+else\s+block\1\s*\)/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/664ed9344ba3495e1f67f8ea.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/664ed9344ba3495e1f67f8ea.md index b1f507713eb..96fa5d54cc9 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/664ed9344ba3495e1f67f8ea.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/664ed9344ba3495e1f67f8ea.md @@ -16,25 +16,25 @@ Do not remove your `character` variable. You should not have a `profession` variable. ```js -assert.notMatch(code, /let\s+profession/); +assert.notMatch(__helpers.removeJSComments(code), /let\s+profession/); ``` You should not have a `age` variable. ```js -assert.notMatch(code, /let\s+age/); +assert.notMatch(__helpers.removeJSComments(code), /let\s+age/); ``` You should not have a `console.log` statement for `age`. ```js -assert.notMatch(code, /console\.log\(\s*age\s*\);/); +assert.notMatch(__helpers.removeJSComments(code), /console\.log\(\s*age\s*\);/); ``` You should not have a `console.log` statement for `profession`. ```js -assert.notMatch(code, /console\.log\(\s*profession\s*\);/); +assert.notMatch(__helpers.removeJSComments(code), /console\.log\(\s*profession\s*\);/); ``` You should still have your `character` variable. diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/665732da4815b70bb083915e.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/665732da4815b70bb083915e.md index 32f2f882dfb..dca2f236fca 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/665732da4815b70bb083915e.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/665732da4815b70bb083915e.md @@ -50,7 +50,7 @@ assert.deepEqual(cities, ["London", "New York", "Mexico City"]); You should have two `console.log(cities)` statements in your code. ```js -assert.lengthOf(code.match(/console\.log\(\s*cities\s*\)/g), 2); +assert.lengthOf(__helpers.removeJSComments(code).match(/console\.log\(\s*cities\s*\)/g), 2); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/665732e62eb8b30c249b5c2c.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/665732e62eb8b30c249b5c2c.md index 2228b56a51b..edb9e38e0d3 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/665732e62eb8b30c249b5c2c.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-introductory-javascript-by-building-a-pyramid-generator/665732e62eb8b30c249b5c2c.md @@ -16,7 +16,7 @@ Remove all of your code from the previous step. You should remove all references to your `cities` variable. ```js -assert.notMatch(code, /cities/); +assert.notMatch(__helpers.removeJSComments(code), /cities/); ``` # --seed--