From ced4ba4a0c0ce3be7baaca3e0a2333348ebc8df6 Mon Sep 17 00:00:00 2001 From: Jessica Wilkins <67210629+jdwilkin4@users.noreply.github.com> Date: Fri, 16 Feb 2024 13:03:50 -0800 Subject: [PATCH] fix(curriculum): allow optional spacing for assignment operator (#53723) --- .../64ddd65848a12919d7e1c7d0.md | 2 +- .../6565bd4265158360de8e2ae7.md | 4 ++-- .../653635c731206b718659d3d5.md | 4 ++-- .../64caeb134c3cdc5498cd75b9.md | 2 +- .../64caeeae2fa57756035d6012.md | 2 +- .../64caf1be15606d5814c3387b.md | 6 +++--- .../64fad07f43a101779cb8692a.md | 4 ++-- .../64fb0fa0968f2b113b2d90e9.md | 4 ++-- .../65386e889dd615940cb3e042.md | 4 ++-- .../653879d87bc55fa624280c77.md | 4 ++-- .../65387b440b5cb1aa35585820.md | 4 ++-- .../6538830e01ab66ade75b869e.md | 4 ++-- .../653883da4a1fabaeb5f1f5e7.md | 4 ++-- .../65388475abfb4faf8dd5e347.md | 4 ++-- .../653884e09dfb4eb01f1622ed.md | 4 ++-- .../6538855514cb16b10204e712.md | 4 ++-- .../65388659a72663b27cde0699.md | 2 +- .../653887098bdc39b3684a51c8.md | 2 +- .../65388762f61f44b3fd490a4a.md | 2 +- 19 files changed, 33 insertions(+), 33 deletions(-) diff --git a/curriculum/challenges/english/07-scientific-computing-with-python/learn-recursion-by-solving-the-tower-of-hanoi-puzzle/64ddd65848a12919d7e1c7d0.md b/curriculum/challenges/english/07-scientific-computing-with-python/learn-recursion-by-solving-the-tower-of-hanoi-puzzle/64ddd65848a12919d7e1c7d0.md index 14425de7f5e..1f304470d1f 100644 --- a/curriculum/challenges/english/07-scientific-computing-with-python/learn-recursion-by-solving-the-tower-of-hanoi-puzzle/64ddd65848a12919d7e1c7d0.md +++ b/curriculum/challenges/english/07-scientific-computing-with-python/learn-recursion-by-solving-the-tower-of-hanoi-puzzle/64ddd65848a12919d7e1c7d0.md @@ -16,7 +16,7 @@ You should move the code nested inside the first `if` statement (except the firs ```js ({ test: () => { - assert.match(code, /def\s+make_allowed_move\(\s*rod1\s*,\s*rod2\s*\):\s+forward\s+=\s+False\s+if\s+not\s+rods\s*\[\s*target\s*\]\s*:\s+forward\s*=\s*True\s+elif\s+rods\s*\[\s*source\s*\]\s+and\s+rods\s*\[\s*source\s*\]\s*\[\s*-1\s*\]\s*<\s*rods\s*\[\s*target\s*\]\s*\[\s*-\s*1\s*\]\s*:\s+forward\s*=\s*True\s+if\s+forward\s*:\s+print\(\s*f'Moving\sdisk\s\{\s*rods\s*\[\s*source\s*\]\s*\[\s*-\s*1\s*\]\s*\}\sfrom\s\{\s*source\s*\}\sto\s\{\s*target\s*\}'\s*\)\s+rods\s*\[\s*target\s*\]\s*\.append\(\s*rods\s*\[\s*source\s*\]\s*\.pop\(\s*\)\s*\)\s+else\s*:\s+print\(\s*f'Moving\sdisk\s\{\s*rods\s*\[\s*target\s*\]\s*\[\s*-\s*1\s*\]\s*\}\sfrom\s\{\s*target\s*\}\sto\s\{\s*source\s*\}'\s*\)\s+rods\s*\[\s*source\s*\]\s*\.append\(\s*rods\s*\[\s*target\s*\]\s*\.pop\(\s*\)\s*\)\s+#\s*display\sour\sprogress\s+print\(\s*rods\s*\)/); + assert.match(code, /def\s+make_allowed_move\(\s*rod1\s*,\s*rod2\s*\):\s+forward\s*=\s*False\s+if\s+not\s+rods\s*\[\s*target\s*\]\s*:\s+forward\s*=\s*True\s+elif\s+rods\s*\[\s*source\s*\]\s+and\s+rods\s*\[\s*source\s*\]\s*\[\s*-1\s*\]\s*<\s*rods\s*\[\s*target\s*\]\s*\[\s*-\s*1\s*\]\s*:\s+forward\s*=\s*True\s+if\s+forward\s*:\s+print\(\s*f'Moving\sdisk\s\{\s*rods\s*\[\s*source\s*\]\s*\[\s*-\s*1\s*\]\s*\}\sfrom\s\{\s*source\s*\}\sto\s\{\s*target\s*\}'\s*\)\s+rods\s*\[\s*target\s*\]\s*\.append\(\s*rods\s*\[\s*source\s*\]\s*\.pop\(\s*\)\s*\)\s+else\s*:\s+print\(\s*f'Moving\sdisk\s\{\s*rods\s*\[\s*target\s*\]\s*\[\s*-\s*1\s*\]\s*\}\sfrom\s\{\s*target\s*\}\sto\s\{\s*source\s*\}'\s*\)\s+rods\s*\[\s*source\s*\]\s*\.append\(\s*rods\s*\[\s*target\s*\]\s*\.pop\(\s*\)\s*\)\s+#\s*display\sour\sprogress\s+print\(\s*rods\s*\)/); } }) ``` diff --git a/curriculum/challenges/english/07-scientific-computing-with-python/learn-regular-expressions-by-building-a-password-generator/6565bd4265158360de8e2ae7.md b/curriculum/challenges/english/07-scientific-computing-with-python/learn-regular-expressions-by-building-a-password-generator/6565bd4265158360de8e2ae7.md index 9799f90428b..bd68bf38cfc 100644 --- a/curriculum/challenges/english/07-scientific-computing-with-python/learn-regular-expressions-by-building-a-password-generator/6565bd4265158360de8e2ae7.md +++ b/curriculum/challenges/english/07-scientific-computing-with-python/learn-regular-expressions-by-building-a-password-generator/6565bd4265158360de8e2ae7.md @@ -14,13 +14,13 @@ Turn the expression inside your `for` loop into an `if` statement. Use the expre You should turn `constraint <= len(re.findall(pattern, password))` into the `if` condition. ```js -({ test: () => assert.match(code, /^(\s*)for.+:\s*^\1(\s{4})if\s+constraint\s* <=\s*len\s*\(\s*re\.findall\s*\(\s*pattern\s*,\s*password\s*\)\s*\)\s*:/m) }) +({ test: () => assert.match(code, /^(\s*)for.+:\s*^\1(\s{4})if\s+constraint\s*<=\s*len\s*\(\s*re\.findall\s*\(\s*pattern\s*,\s*password\s*\)\s*\)\s*:/m) }) ``` You should increment `count` by one inside your new `if` statement. ```js -({ test: () => assert.match(code, /^(\s*)for.+:\s*^\1(\s{4})if\s+constraint\s* <=\s*len\s*\(\s*re\.findall\s*\(\s*pattern\s*,\s*password\s*\)\s*\)\s*:\s*^\1\2\2(count\s*\+=\s*1|count\s*=\s*count\s*\+\s*1)/m) }) +({ test: () => assert.match(code, /^(\s*)for.+:\s*^\1(\s{4})if\s+constraint\s*<=\s*len\s*\(\s*re\.findall\s*\(\s*pattern\s*,\s*password\s*\)\s*\)\s*:\s*^\1\2\2(count\s*\+=\s*1|count\s*=\s*count\s*\+\s*1)/m) }) ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/653635c731206b718659d3d5.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/653635c731206b718659d3d5.md index 2f9e1cca28f..043546ebe17 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/653635c731206b718659d3d5.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/653635c731206b718659d3d5.md @@ -16,13 +16,13 @@ Also, set the `audio.title` property equal to `song.title`. This tells the audio You should not modify the existing `playSong` function and its content. ```js -assert.match(code, /const\s+playSong\s*=\s*\(\s*id\s*\)\s*=>\s*\{\s*const\s+song\s*=\s*userData\?\.songs\.find\(\s*\(\s*song\s*\)\s=>\s*song\.id\s===\s*id\s*\);?/) +assert.match(code, /const\s+playSong\s*=\s*\(\s*id\s*\)\s*=>\s*\{\s*const\s+song\s*=\s*userData\?\.songs\.find\(\s*\(\s*song\s*\)\s*=>\s*song\.id\s*===\s*id\s*\);?/) ``` You should set `audio.src` to `song.src`. ```js -assert.match(code, /const\s+playSong\s*=\s*\(\s*id\s*\)\s*=>\s*\{\s*const\s+song\s*=\s*userData\?\.songs\.find\(\s*\(\s*song\s*\)\s=>\s*song\.id\s===\s*id\s*\);?\s*audio\.src\s*=\s*song\.src;?/) +assert.match(code, /const\s+playSong\s*=\s*\(\s*id\s*\)\s*=>\s*\{\s*const\s+song\s*=\s*userData\?\.songs\.find\(\s*\(\s*song\s*\)\s=>\s*song\.id\s*===\s*id\s*\);?\s*audio\.src\s*=\s*song\.src;?/) ``` You should set `audio.title` to `song.title`. diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64caeb134c3cdc5498cd75b9.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64caeb134c3cdc5498cd75b9.md index f2f7867a32a..c8479511f3a 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64caeb134c3cdc5498cd75b9.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64caeb134c3cdc5498cd75b9.md @@ -14,7 +14,7 @@ Inside that array, add a boolean expression that checks if the player's `x` posi You should have a boolean expression that checks if the player's `x` position is greater than or equal to the platform's `x` position minus half of the player's width. ```js -assert.match(code, /const\s+platformDetectionRules\s+=\s*\[\s*player\.position\.x\s*>=\s*platform\.position\.x\s*-\s*player\.width\s*\/\s*2\s*,?\s*\]\s*;?/) +assert.match(code, /const\s+platformDetectionRules\s*=\s*\[\s*player\.position\.x\s*>=\s*platform\.position\.x\s*-\s*player\.width\s*\/\s*2\s*,?\s*\]\s*;?/) ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64caeeae2fa57756035d6012.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64caeeae2fa57756035d6012.md index 0b1d60185cf..827bfdf41cc 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64caeeae2fa57756035d6012.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64caeeae2fa57756035d6012.md @@ -14,7 +14,7 @@ Below that boolean expression, add another boolean expression that checks if the You should have a boolean expression that checks if the player's `x` position is less than or equal to the sum of the platform's `x` position and the platform's width minus one third of the player's width. ```js -assert.match(code, /const\s+platformDetectionRules\s+=\s*\[\s*player\.position\.x\s*>=\s*platform\.position\.x\s*-\s*player\.width\s*\/\s*2\s*,\s*player\.position\.x\s*<=\s*platform\.position\.x\s*\+\s*platform\.width\s*-\s*player\.width\s*\/\s*3\s*,?\s*\]\s*;?/) +assert.match(code, /const\s+platformDetectionRules\s*=\s*\[\s*player\.position\.x\s*>=\s*platform\.position\.x\s*-\s*player\.width\s*\/\s*2\s*,\s*player\.position\.x\s*<=\s*platform\.position\.x\s*\+\s*platform\.width\s*-\s*player\.width\s*\/\s*3\s*,?\s*\]\s*;?/) ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64caf1be15606d5814c3387b.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64caf1be15606d5814c3387b.md index 1b4e05a0342..4b2d81c3c67 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64caf1be15606d5814c3387b.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64caf1be15606d5814c3387b.md @@ -16,21 +16,21 @@ Below that, add another boolean expression that checks if the player's `y` posit You should not alter the existing `platformDetectionRules` array and its content. ```js -assert.match(code, /const\s+platformDetectionRules\s+=\s*\[\s*player\.position\.x\s*>=\s*platform\.position\.x\s*-\s*player\.width\s*\/\s*2\s*,\s*player\.position\.x\s*<=\s*platform\.position\.x\s*\+\s*platform\.width\s*-\s*player\.width\s*\/\s*3\s*,\s*.*\s*.*\s*\]\s*;?/) +assert.match(code, /const\s+platformDetectionRules\s*=\s*\[\s*player\.position\.x\s*>=\s*platform\.position\.x\s*-\s*player\.width\s*\/\s*2\s*,\s*player\.position\.x\s*<=\s*platform\.position\.x\s*\+\s*platform\.width\s*-\s*player\.width\s*\/\s*3\s*,\s*.*\s*.*\s*\]\s*;?/) ``` You should have a boolean expression that checks if the player's `y` position plus the player's height is greater than or equal to the platform's `y` position. ```js -assert.match(code, /const\s+platformDetectionRules\s+=\s*\[\s*player\.position\.x\s*>=\s*platform\.position\.x\s*-\s*player\.width\s*\/\s*2\s*,\s*player\.position\.x\s*<=\s*platform\.position\.x\s*\+\s*platform\.width\s*-\s*player\.width\s*\/\s*3\s*,\s*player\.position\.y\s*\+\s*player\.height\s*>=\s*platform\.position\.y\s*,\s*.*\s*\]\s*;?/) +assert.match(code, /const\s+platformDetectionRules\s*=\s*\[\s*player\.position\.x\s*>=\s*platform\.position\.x\s*-\s*player\.width\s*\/\s*2\s*,\s*player\.position\.x\s*<=\s*platform\.position\.x\s*\+\s*platform\.width\s*-\s*player\.width\s*\/\s*3\s*,\s*player\.position\.y\s*\+\s*player\.height\s*>=\s*platform\.position\.y\s*,\s*.*\s*\]\s*;?/) ``` You should have a boolean expression that checks if the player's `y` position is less than or equal to the sum of the platform's `y` position plus the platform's height. ```js -assert.match(code, /const\s+platformDetectionRules\s+=\s*\[\s*player\.position\.x\s*>=\s*platform\.position\.x\s*-\s*player\.width\s*\/\s*2\s*,\s*player\.position\.x\s*<=\s*platform\.position\.x\s*\+\s*platform\.width\s*-\s*player\.width\s*\/\s*3\s*,\s*player\.position\.y\s*\+\s*player\.height\s*>=\s*platform\.position\.y\s*,\s*player\.position\.y\s*<=\s*platform\.position\.y\s*\+\s*platform\.height\s*,?\s*\]\s*;?/) +assert.match(code, /const\s+platformDetectionRules\s*=\s*\[\s*player\.position\.x\s*>=\s*platform\.position\.x\s*-\s*player\.width\s*\/\s*2\s*,\s*player\.position\.x\s*<=\s*platform\.position\.x\s*\+\s*platform\.width\s*-\s*player\.width\s*\/\s*3\s*,\s*player\.position\.y\s*\+\s*player\.height\s*>=\s*platform\.position\.y\s*,\s*player\.position\.y\s*<=\s*platform\.position\.y\s*\+\s*platform\.height\s*,?\s*\]\s*;?/) ``` diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64fad07f43a101779cb8692a.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64fad07f43a101779cb8692a.md index 3e073a8ecd2..ddabb6b5bc0 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64fad07f43a101779cb8692a.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64fad07f43a101779cb8692a.md @@ -22,13 +22,13 @@ assert.match(code, /const\s+addOrUpdateTask\s*=\s*\(\s*\)\s*=>\s*\{\s*/) You should move the `dataArrIndex` variable into the `addOrUpdateTask` function. ```js -assert.match(code, /const\s+addOrUpdateTask\s*=\s*\(\s*\)\s*=>\s*\{\s*const\s+dataArrIndex\s*=\s*taskData\.findIndex\(\s*(\(\s*item\s*\)|item)\s*=>\s*(item\.id\s===\s*currentTask\.id|currentTask\.id\s*===\s*item\.id)\s*\);?/) +assert.match(code, /const\s+addOrUpdateTask\s*=\s*\(\s*\)\s*=>\s*\{\s*const\s+dataArrIndex\s*=\s*taskData\.findIndex\(\s*(\(\s*item\s*\)|item)\s*=>\s*(item\.id\s*===\s*currentTask\.id|currentTask\.id\s*===\s*item\.id)\s*\);?/) ``` You should move the `taskObj` object into the `addOrUpdateTask` function. ```js -assert.match(code, /const\s+addOrUpdateTask\s*=\s*\(\s*\)\s*=>\s*\{\s*const\s+dataArrIndex\s*=\s*taskData\.findIndex\(\s*(?:\(\s*item\s*\)|item)\s*=>\s*(?:item\.id\s===\s*currentTask\.id|currentTask\.id\s*===\s*item\.id)\s*\)\s*;?\s*const\s+taskObj\s*=\s*\{\s*id\s*:\s*`\$\{\s*titleInput\.value\.toLowerCase\(\s*\)\.split\(\s*('|")\s{1}\1\s*\)\.join\(\s*('|")-\2\s*\)\s*\}-\$\{\s*Date\.now\(\s*\)\s*\}`\s*,\s*title\s*:\s*titleInput\.value\s*,\s*date\s*:\s*dateInput\.value\s*,\s*description\s*:\s*descriptionInput\.value\s*,?\s*\}\s*;?/) +assert.match(code, /const\s+addOrUpdateTask\s*=\s*\(\s*\)\s*=>\s*\{\s*const\s+dataArrIndex\s*=\s*taskData\.findIndex\(\s*(?:\(\s*item\s*\)|item)\s*=>\s*(?:item\.id\s*===\s*currentTask\.id|currentTask\.id\s*===\s*item\.id)\s*\)\s*;?\s*const\s+taskObj\s*=\s*\{\s*id\s*:\s*`\$\{\s*titleInput\.value\.toLowerCase\(\s*\)\.split\(\s*('|")\s{1}\1\s*\)\.join\(\s*('|")-\2\s*\)\s*\}-\$\{\s*Date\.now\(\s*\)\s*\}`\s*,\s*title\s*:\s*titleInput\.value\s*,\s*date\s*:\s*dateInput\.value\s*,\s*description\s*:\s*descriptionInput\.value\s*,?\s*\}\s*;?/) ``` You should move the `if` statement with the condition `dataArrIndex === -1` into your `addOrUpdateTask` function. diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64fb0fa0968f2b113b2d90e9.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64fb0fa0968f2b113b2d90e9.md index e3256e34282..ae9af966d03 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64fb0fa0968f2b113b2d90e9.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64fb0fa0968f2b113b2d90e9.md @@ -28,13 +28,13 @@ assert.match(code, /const\s+editTask\s*=\s*\(\s*buttonEl\s*\)\s*=>\s*\{\s*const\ You should pass in `item` as the parameter of the `findIndex()` arrow function callback. Don't use curly braces. ```js -assert.match(code, /const\s+editTask\s+=\s*\(\s*buttonEl\s*\)\s*=>\s*\{\s*const\s+dataArrIndex\s*=\s*taskData\.findIndex\(\s*(\(\s*item\s*\)|item)/) +assert.match(code, /const\s+editTask\s*=\s*\(\s*buttonEl\s*\)\s*=>\s*\{\s*const\s+dataArrIndex\s*=\s*taskData\.findIndex\(\s*(\(\s*item\s*\)|item)/) ``` Your arrow function callback should check if `item.id === buttonEl.parentElement.id`. ```js -assert.match(code, /const\s+editTask\s+=\s*\(\s*buttonEl\s*\)\s*=>\s*\{\s*const\s+dataArrIndex\s*=\s*taskData\.findIndex\(\s*(\(\s*item\s*\)|item)\s*=>\s*(item\.id\s*===\s*buttonEl\.parentElement\.id|buttonEl\.partentElement\.id\s*===\s*item\.id)\s*\);?\s*\};?/) +assert.match(code, /const\s+editTask\s*=\s*\(\s*buttonEl\s*\)\s*=>\s*\{\s*const\s+dataArrIndex\s*=\s*taskData\.findIndex\(\s*(\(\s*item\s*\)|item)\s*=>\s*(item\.id\s*===\s*buttonEl\.parentElement\.id|buttonEl\.parentElement\.id\s*===\s*item\.id)\s*\);?\s*\};?/) ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65386e889dd615940cb3e042.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65386e889dd615940cb3e042.md index c1a537dc223..9822bf89cd9 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65386e889dd615940cb3e042.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65386e889dd615940cb3e042.md @@ -18,7 +18,7 @@ Start by getting the `#current-date` element using the `.getElementById()` metho You should use `const` to declare a `currentDateParagraph` variable. ```js -assert.match(code, /const\s+currentDateParagraph\s+=/); +assert.match(code, /const\s+currentDateParagraph\s*=/); ``` You should use `document.getElementById()` to get the `#current-date` element. @@ -30,7 +30,7 @@ assert.match(code, /document\.getElementById\(\s*('|"|`)current-date\1\s*\)/); You should assign the `#current-date` element to your `currentDateParagraph` variable. ```js -assert(code.match(/const\s+currentDateParagraph\s+=\s+document\.getElementById\(\s*('|"|`)current-date\1\s*\)/g)); +assert(code.match(/const\s+currentDateParagraph\s*=\s*document\.getElementById\(\s*('|"|`)current-date\1\s*\)/g)); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/653879d87bc55fa624280c77.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/653879d87bc55fa624280c77.md index 47c15587f56..8179b40a44b 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/653879d87bc55fa624280c77.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/653879d87bc55fa624280c77.md @@ -14,7 +14,7 @@ Use the `.getElementById()` method to get the `#date-options` element and use `c You should use `const` to declare a `dateOptionsSelectElement` variable. ```js -assert.match(code, /const\s+dateOptionsSelectElement\s+=/); +assert.match(code, /const\s+dateOptionsSelectElement\s*=/); ``` You should use `document.getElementById()` to get the `#date-options` element. @@ -26,7 +26,7 @@ assert.match(code, /document\.getElementById\(\s*('|"|`)date-options\1\s*\)/); You should assign the `#date-options` element to your `dateOptionsSelectElement` variable. ```js -assert(code.match(/const\s+dateOptionsSelectElement\s+=\s+document\.getElementById\(\s*('|"|`)date-options\1\s*\)/g)); +assert(code.match(/const\s+dateOptionsSelectElement\s*=\s*document\.getElementById\(\s*('|"|`)date-options\1\s*\)/g)); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65387b440b5cb1aa35585820.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65387b440b5cb1aa35585820.md index 7a064099cb4..facf88e71ce 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65387b440b5cb1aa35585820.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65387b440b5cb1aa35585820.md @@ -26,13 +26,13 @@ Create a new `const` variable called `date` and assign it a `Date` object with ` You should use `const` to declare a `date` variable. ```js -assert.match(code, /const\s+date\s+=/); +assert.match(code, /const\s+date\s*=/); ``` You should assign a `Date` object to your `date` variable with `new Date()`. ```js -assert(code.match(/const\s+date\s+=\s+new\s+Date\(\s*\)/g)); +assert(code.match(/const\s+date\s*=\s*new\s+Date\(\s*\)/g)); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/6538830e01ab66ade75b869e.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/6538830e01ab66ade75b869e.md index 9e8da0034f4..2dbf4661b8b 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/6538830e01ab66ade75b869e.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/6538830e01ab66ade75b869e.md @@ -24,13 +24,13 @@ Using `const`, create a variable named `day` and assign it the day of the month You should use `const` to declare a `day` variable. ```js -assert.match(code, /const\s+day\s+=/); +assert.match(code, /const\s+day\s*=/); ``` You should assign the `date.getDate()` to your `day` variable. ```js -assert(code.match(/const\s+day\s+=\s+date\.getDate\(\s*\)/g)); +assert(code.match(/const\s+day\s*=\s*date\.getDate\(\s*\)/g)); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/653883da4a1fabaeb5f1f5e7.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/653883da4a1fabaeb5f1f5e7.md index 5a14ce0bcc4..b3923fb28fd 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/653883da4a1fabaeb5f1f5e7.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/653883da4a1fabaeb5f1f5e7.md @@ -18,13 +18,13 @@ Remember to add `1` to the number returned by `.getMonth()`. You should use `const` to declare a `month` variable. ```js -assert.match(code, /const\s+month\s+=/); +assert.match(code, /const\s+month\s*=/); ``` You should assign the `date.getMonth() + 1` to your `month` variable. ```js -assert(code.match(/const\s+month\s+=\s+date\.getMonth\(\s*\)\s*\+\s*1/g)); +assert(code.match(/const\s+month\s*=\s*date\.getMonth\(\s*\)\s*\+\s*1/g)); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65388475abfb4faf8dd5e347.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65388475abfb4faf8dd5e347.md index b2d4d8ec05a..9d06aa54e9c 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65388475abfb4faf8dd5e347.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65388475abfb4faf8dd5e347.md @@ -16,13 +16,13 @@ Using `const`, create a variable named `year` and assign it the year from `date` You should use `const` to declare a `year` variable. ```js -assert.match(code, /const\s+year\s+=/); +assert.match(code, /const\s+year\s*=/); ``` You should assign the `date.getFullYear()` to your `year` variable. ```js -assert(code.match(/const\s+year\s+=\s+date\.getFullYear\(\s*\)/g)); +assert(code.match(/const\s+year\s*=\s*date\.getFullYear\(\s*\)/g)); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/653884e09dfb4eb01f1622ed.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/653884e09dfb4eb01f1622ed.md index ee5b17ed5f6..1805084dd9a 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/653884e09dfb4eb01f1622ed.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/653884e09dfb4eb01f1622ed.md @@ -16,13 +16,13 @@ Create a `const` variable named `hours` and assign it the hour from `date` with You should use `const` to declare a `hours` variable. ```js -assert.match(code, /const\s+hours\s+=/); +assert.match(code, /const\s+hours\s*=/); ``` You should assign the `date.getHours()` to your `hours` variable. ```js -assert(code.match(/const\s+hours\s+=\s+date\.getHours\(\s*\)/g)); +assert(code.match(/const\s+hours\s*=\s*date\.getHours\(\s*\)/g)); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/6538855514cb16b10204e712.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/6538855514cb16b10204e712.md index 5bdd824a5bb..d2ce938ad60 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/6538855514cb16b10204e712.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/6538855514cb16b10204e712.md @@ -16,13 +16,13 @@ Create a `const` variable named `minutes` and assign it the minutes from `date` You should use `const` to declare a `minutes` variable. ```js -assert.match(code, /const\s+minutes\s+=/); +assert.match(code, /const\s+minutes\s*=/); ``` You should assign the `date.getMinutes()` to your `minutes` variable. ```js -assert(code.match(/const\s+minutes\s+=\s+date\.getMinutes\(\s*\)/g)); +assert(code.match(/const\s+minutes\s*=\s*date\.getMinutes\(\s*\)/g)); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65388659a72663b27cde0699.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65388659a72663b27cde0699.md index 2710d11ae38..6296a428a44 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65388659a72663b27cde0699.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65388659a72663b27cde0699.md @@ -14,7 +14,7 @@ Inside the template literal, add an embedded expression that contains the `day` You should use the `day` constant inside the template literal. ```js -assert(code.match(/const\s+formattedDate\s+=\s+`\${day}`/g)); +assert(code.match(/const\s+formattedDate\s*=\s*`\${day}`/g)); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/653887098bdc39b3684a51c8.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/653887098bdc39b3684a51c8.md index fc1b024a7c0..e8376096e3a 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/653887098bdc39b3684a51c8.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/653887098bdc39b3684a51c8.md @@ -14,7 +14,7 @@ After the `day` variable, add a dash (`-`) followed by another embedded expressi You should add a dash followed by the `month` constant to the template literal. ```js -assert(code.match(/const\s+formattedDate\s+=\s+`\${day}\s*-\s*\${month}`/g)); +assert(code.match(/const\s+formattedDate\s*=\s*`\${day}\s*-\s*\${month}`/g)); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65388762f61f44b3fd490a4a.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65388762f61f44b3fd490a4a.md index 32716c45f70..b449ed8e909 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65388762f61f44b3fd490a4a.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-the-date-object-by-building-a-date-formatter/65388762f61f44b3fd490a4a.md @@ -14,7 +14,7 @@ After the `month` variable, add a dash followed by another embedded expression t You should add a dash followed by the `year` constant to the template literal. ```js -assert(code.match(/const\s+formattedDate\s+=\s+`\${day}\s*-\s*\${month}\s*-\s*\${year}`/g)); +assert(code.match(/const\s+formattedDate\s*=\s*`\${day}\s*-\s*\${month}\s*-\s*\${year}`/g)); ``` # --seed--