Typical! Always in my case. Get to the last step and bomb! They don’t let you pass! LOL Step 66
Finally, it is time to call the removeSpecialChars on the id property in your taskObj.
This will help prevent issues caused by special characters in HTML element IDs.
With that you have completed the project.
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
const taskObj = {
id: removeSpecialChars(`${titleInput.value.toLowerCase().split(" ").join("-")}-${Date.now()}`),
title: titleInput.value,
date: dateInput.value,
description: descriptionInput.value,
};
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0
How does it make sense to remove special characters from a string method, an array method, and a date when the purpose of removeSpecialChars() is to remove special characters from HTML element ids as stated in the instructions?
This will help prevent issues caused by special characters in HTML element IDs.
Because you wouldn’t want those characters in the date either? Also yea the typo that now that i see it is funny. Sometimes that is accurate for code…….evil code
if just worrying about the ID
I tried
id: `${removeSpecialChars(titleInput.value.toLowerCase().split(" “).join(”-"))}-${Date.now()}`,
There might be some confusion since it looks like the regular expression in the given code has been changed to /[^A-Za-z0-9\-\s]/g (sometime since I did this last year).