Learn localStorage by Building a Todo App - Step 53

Tell us what’s happening:

I’m not sure why this solution isn’t working. I’ve tried this ternary operator, as well as an arrow function with an if statement.

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

const formInputValuesUpdated = titleInput.value != currentTask.title || dateInput.value != currentTask.title || descriptionInput.value != currentTask.description ? true : false;

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0

Challenge Information:

Learn localStorage by Building a Todo App - Step 53

You didn’t need ternary operator for this challenge step. Remove it so your challenge will pass.
@SlicedVantage

Hello;
There are two things to note here. First, the not equal operator: if you use != instead of !==, it only checks the value but doesn’t consider the types. For example:

5 != "5" //This return false
5 !== "5" //This return true

Additionally, this syntax returns a boolean value. If the values are not equal, it will return true, and your variable will take the corresponding boolean value based on that conditions.
Also one comparision is not right. You comparing dateInput with title. Happy coding :slightly_smiling_face:.

This is the code i have:

const formInputValuesUpdated = titleInput.value !== currentTask.title ||
dateInput.value !== currentTask.date ||
descriptionInput.value !== currentTask.description;

This is the error im getting:

Your formInputValuesUpdated variable should check if titleInput.value is not equal to currentTask.title or dateInput.value is not equal to currentTask.date .

This is the my answer:

Your code is not working because the lesson code editor doesn’t understand the code after the ‘or’ operator when it’s on a new line. Your code is not wrong, but it needs to be written on the same line.
:slightly_smiling_face: