Tell us what’s happening:
It wants me to compare whether titleInput is the same as currentTaskTitle or not.
I did it this way but gives error;
const formInputValuesUpdated = (
titleInput.value !== currentTask.title ||
dateInput.value !== currentTask.date ||
descriptionInput.value !== currentTask.description
);
Your code so far
<!-- file: index.html -->
/* file: script.js */
// User Editable Region
const formInputsContainValues = titleInput.value || dateInput.value || descriptionInput.value;
const formInputValuesUpdated = (
titleInput.value !== currentTask.title ||
dateInput.value !== currentTask.date ||
descriptionInput.value !== currentTask.description
);
// User Editable Region
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Challenge Information:
Learn localStorage by Building a Todo App - Step 52
Remove the parenthesis and see what is going to happen!
Hi there and welcome to our community!
Why have you added parentheses when declaring your formInputValuesUpdated
variable? Your code should pass if you use the same format as the formInputsContainValues
variable.
1 Like
Did you remove the parenthesis from are the values of formInputValuesUpdated variable? if yes, then the code should be able to run or execute the task. Use one equal sign
//example
formInputValuesUpdated = example.value != currentExample.title
const formInputValuesUpdated =
titleInput.value != currentTask.title ||
dateInput.value != currentTask.date ||
descriptionInput.value != currentTask.description;
I also tried like this and I don’t understand my mistake.
there is a bug, in currentTask.title a colon appears under the ‘title’
Even though colon appears in the code, but it should pass the task. The colon is actually not a bug. I have ran across that throughout my coding, Especially deeding with Constructor and Object
const formInputValuesUpdated = titleInput.value != currentTask.title || dateInput.value != currentTask.date || descriptionInput.value != currentTask.description;
Try to reformat so that there are no additional spaces/returns between each condition.
// like this
const variable = condition1 || condition2 || condition3
// not like this
const variable = condition1 ||
condition2 ||
condition3
2 Likes
hi there!
rewrite that code in one line, make sure do not use the Enter
key for white space.
1 Like
I pasted it and it worked thank you so much, This step took me a long time and I was demoralized.
This do happen to myself too. I sometime spent hours fighting to figure it out. Anyway, Code Sunday
1 Like