Change:
In step 30, we refactor the code a bit by splitting up code we already wrote into functions. One of the statements to move is an if statement which checks the result of a findIndex function on an array. I forgot to mark the if statement in my cut-paste job and got the following note when checking the code: Unfortunately the condition in the note is completely wrong as the condition we want is to check if it's equal to -1 as that is the flag the findIndex function returns if it doesn't find a match. If the return value was 1, that's the id and we'd not want to enter the if statement. It's only the note which is wrong, and if I enter if (dataArrIndex === 1) { taskData.unshift(taskObj); } in the code, then I still have the note when checking the code, and only the actual correct if statement of equalling -1 lets me continue. But I'm sure such a situation could be frustrating for a camper if they write what's in the note and stay stuck To not accept the code and display a note saying the if condition should be ! Device: VivioBook ASUS Laptop OS: Windows 11 Home Browser: Mozilla Firefox No response
Thanks for opening this issue. This looks something that can be fixed by "first time" code contributors to this repository. Here are the files that you should be looking at to work on a fix: List of files: Please make sure you read , we prioritize contributors following the instructions in our guides. Join us in or if you need help contributing, our moderators will guide you through this. Sometimes we may get more than one pull requests. We typically accept the most quality contribution followed by the one that is made first. Happy contributing.
Thank you. I tried to fix it in the repository. Hope I did it properly :)
I see that you made a commit to your forked copy of the project here <img width="416" alt="Screenshot 2024-02-08 at 4 10 12 PM" src=""But I don't see any new pull requests opened by you. Please read through the to learn how to make a pull request. If you need help, then please post on either the forum or discord with your question and people can assist you there

Discussion:
assert.match(code, /consts+addOrUpdateTasks*=s*(s*)s*=>s*{s*consts+dataArrIndexs*=s*taskData.findIndex(s*(?:(s*items*)|item)s*=>s*(?:item.ids===s*currentTask.id|currentTask.ids*===s*item.id)s*)s*;?s*consts+taskObjs*=s*{s*ids*:s*`${s*titleInput.value.toLowerCase(s*).split(s*('|")s{1}1s*).join(s*('|")-2s*)s*}-${s*Date.now(s*)s*}`s*,s*titles*:s*titleInput.value,s*dates*:s*dateInput.values*,s*descriptions*:s*descriptionInput.values*,?s*}s*;?/) ``` <del> You should move the `if` statement with the condition `dataArrIndex === 1` into your `addOrUpdateTask` function. </del> <ins> You should move the `if` statement with the condition `dataArrIndex === -1` into your `addOrUpdateTask` function. </ins> ```js assert.match(code, /consts+addOrUpdateTasks*=s*(s*)s*=>s*{s*consts+dataArrIndexs*=s*taskData.findIndex(s*(?:(s*items*)|item)s*=>s*(?:item.ids*===s*currentTask.id|currentTask.ids*===s*item.id)s*)s*;?s*consts+taskObjs*=s*{s*ids*:s*`${s*titleInput.value.toLowerCase(s*).split(s*('|")s{1}1s*).join(s*('|")-2s*)s*}-${s*Date.now(s*)s*}`s*,s*titles*:s*titleInput.value,s*dates*:s*dateInput.values*,s*descriptions*:s*descriptionInput.values*,?s*}s*;?s*ifs*(s*dataArrIndexs*===s*-1s*)s*{s*taskData.unshift(s*taskObjs*)s*;?s*}s*}s*;?/)