I’ve tried different variations of this if-statement but it seems like I maybe don’t know how to use if-statements anymore or English is just killing me. I’ve searched through previous questions and solutions from the forum and I don’t see anything wrong with my approach. Please, maybe I’m in need of a different set of eyes.
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
closeTaskFormBtn.addEventListener("click", () => {
if (titleInput.value !== "" || dateInput.value !== "" || descriptionInput.value !== "") {
reset();
} else {
confirmCloseDialog.showModal();
}
});
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0
Challenge Information:
Learn localStorage by Building a Todo App - Step 34
what is this checking? and then consider, if there is values or if there aren’t in each field, what does happen? and is that in line with the requirements?
mhh! i’m assuming its checking if either one of the inputs have fields, which i’m assuming i’m checking correctly by just doing the inverse which is if the inputs don’t have any inputs then reset but if one of them does, which will result to true in the if statement then show the modal, i’m i right?
i don’t know if my brain is failing me today or what because i’m understanding that’s exactly what my code does but according to the checker, it’s not. is there someway to write this maybe using switch because i tried