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--