Learn localStorage by Building a Todo App - Step 68

Tell us what’s happening:

I have called the function on all variable assignment but still cant pass the code:

const taskObj = {
    id: removeSpecialChars(`${titleInput.value.toLowerCase().split(" ").join("-")}-${Date.now()}`),
    title: removeSpecialChars(titleInput.value),
    date: dateInput.value,
    description: removeSpecialChars(descriptionInput.value),
  };

Your code so far

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

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

  const taskObj = {
    id: removeSpecialChars(`${titleInput.value.toLowerCase().split(" ").join("-")}-${Date.now()}`),
    title: removeSpecialChars(titleInput.value),
    date: dateInput.value,
    description: removeSpecialChars(descriptionInput.value),
  };

// 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/131.0.0.0 Safari/537.36 Edg/131.0.0.0

Challenge Information:

Learn localStorage by Building a Todo App - Step 68

Instructions are a bit misleading here, the hint displayed is making more clear what is needed:

You should call removeSpecialChars on titleInput.value when assigning the id .

Would you be interested in creating issue for this problem in the freeCodeCamp’s GitHub repository?

Hi there!

It’s not an issue I think. The purpose behind the challenge instructions is to check your ability of previous learning. Then the test give the correct hint below, when someone isn’t able to pass the challenge.

1 Like

The requirements say you should call the function on the property and then corrects it to only part of the value in the hints, I would call that misleading.

If you follow the requirements to the letter, you are guarantied to fail the first time because the requirements are wrong.


Finally, it is time to call the removeSpecialChars on the id, title, and description properties in your taskObj.

Call removeSpecialChars on the title, and description properties in your taskObj. For the id property, only call it on the titleInput.value part of the property value.


PR

2 Likes