From dbde6844a077f6be368ba5e6d6e2a642a8f9d316 Mon Sep 17 00:00:00 2001 From: a2937 Date: Tue, 27 Feb 2024 04:37:50 -0500 Subject: [PATCH] fix(curriculum): allow for strict and regular inequality operator step 47 (#53606) Co-authored-by: Joy Shaheb --- .../64fb1c4dc0feb219149a7c7d.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64fb1c4dc0feb219149a7c7d.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64fb1c4dc0feb219149a7c7d.md index fe2a7f6649a..8b3076faef0 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64fb1c4dc0feb219149a7c7d.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64fb1c4dc0feb219149a7c7d.md @@ -16,19 +16,26 @@ Inside the `closeTaskFormBtn` event listener, use `const` to create another vari Your `formInputValuesUpdated` variable should check if `titleInput.value` is not equal to `currentTask.title`. ```js -assert.match(code, /const\s+formInputValuesUpdated\s*=\s*titleInput\.value\s*!==\s*currentTask\.title\s*/) +const regex = /const\s+formInputValuesUpdated\s*=(?=.*titleInput\.value\s*(!==|!=)\s*currentTask\.title)/ + +assert.match(code, regex) ``` Your `formInputValuesUpdated` variable should check if `titleInput.value` is not equal to `currentTask.title` or `dateInput.value` is not equal to `currentTask.date`. ```js -assert.match(code, /const\s+formInputValuesUpdated\s*=\s*titleInput\.value\s*!==\s*currentTask\.title\s*\|\|\s*dateInput\.value\s*!==\s*currentTask\.date/) +const regex = /const\s+formInputValuesUpdated\s*=(?=.*titleInput\.value\s*(!==|!=)\s*currentTask\.title)(?=.*dateInput\.value\s*(?:!==|!=)\s*currentTask\.date)/ + +assert.match(code, regex); + ``` -Your `formInputValuesUpdated` variable should have the value `titleInput.value !== currentTask.title || dateInput.value !== currentTask.date || descriptionInput.value !== currentTask.description`. +Your `formInputValuesUpdated` variable should check if `titleInput.value` is not equal to `currentTask.title`, `dateInput.value` is not equal to `currentTask.date`, or `descriptionInput.value` is not equal to `currentTask.description`. ```js -assert.match(code, /const\s+formInputValuesUpdated\s*=\s*titleInput\.value\s*!==\s*currentTask\.title\s*\|\|\s*dateInput\.value\s*!==\s*currentTask\.date\s*\|\|\s*descriptionInput\.value\s*!==\s*currentTask\.description\s*;?/) +const regex = /const\s+formInputValuesUpdated\s*=\s*titleInput\.value\s*!==\s*currentTask\.title\s*\|\|\s*dateInput\.value\s*!==\s*currentTask\.date\s*\|\|\s*descriptionInput\.value\s*!==\s*currentTask\.description\s*;?/ + +assert.match(code, regex); ``` # --seed--