Learn localStorage by Building a Todo App - Step 34

Tell us what’s happening:

here in the instructions says “create a (variable) named formInputsContainValues” but when i set it to variable and submit, my code get rejected because it should be a constant not a variable.

Your code so far

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

/* file: styles.css */

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

closeTaskFormBtn.addEventListener("click", () => {
  confirmCloseDialog.showModal();
 var  formInputsContainValues = titleInput.value || dateInput.value || descriptionInput.value
});

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0

Challenge Information:

Learn localStorage by Building a Todo App - Step 34

Welcome to the forum @ktarimouadh

var is used to declare a variable
const is used to declare a variable that cannot be reassigned a new value

Either can be used to declare variables.

For this challenge you need to declare the variable using const

Happy coding

I’m getting confused to say variable to a constant it sounds not accurate
i think using (attribute) is better than (variable) to describe such common things in all impartiality

also const cannot be reassigned or modified i think it would be mistake to call it a “variable”, right?

Hi

Here is a short article about variables you may find helpful.

Variables are for storing information. Whether they can change depends on how they are declared.

Happy coding