Build a Palindrome Checker - Issues

Okay, there are two problems in this project. One of them is that it requires the use of a regex like this: /[a-z0-9]+/ig. However, the only previous course before this project where regex was taught was Learn Form Validation by Building a Calorie Counter from steps 19 to 33. The problem is that they didn’t teach how to match alphabet characters from a to z; they only taught how to match numeric characters from 0 to 9. So, the only way to do it was to try with imagination until you solved it by imitating the way to match numeric characters, doing something like this: /[abcdefghijklmnopqrstuvwxyz0-9]/ or searching online.

There is also another problem, and that is that they didn’t teach how to not match spacing. A beginner might have done this: /[abcdefghijklmnopqrstuvwxyz 0-9]/, which will match a whitespace.

And the last problem is that they didn’t teach in previous courses how to convert text to the same case (uppercase to lowercase)(toLowerCase() method) . So, a beginner wouldn’t know what to do unless they rack their brains until they achieve something like this:

const upToLow = {
  'A': 'a', 'B': 'b', 'C': 'c', 'D': 'd', 'E': 'e', 'F': 'f', 'G': 'g', 'H': 'h', 'I': 'i', 'J': 'j', 'K': 'k', 'L': 'l', 'M':'m', 'N': 'n', 'O': 'o', 'P': 'p', 'Q': 'q', 'R': 'r', 'S':'s', 'T': 't', 'U': 'u', 'V': 'v', 'W': 'w', 'X': 'x', 'Y': 'y', 'Z': 'z'
};

const text1 = "HELLO WORLD";
let lowText = '';
for (let i = 0; i < text1.length; i++) {
  const char = text1[i];
  lowText += upToLow[char] || char;
}

I have a good foundation in JavaScript, so I always knew what to do. However, I am criticizing this to help beginners.
Please note that English is not my first language. I want to provide constructive criticism, and I apologize if anything sounds offensive.

1 Like

Thanks for this.

I actually just finished this project in the new full stack curriculum and I would say this is better now. All the regex you need to know is introduced before this project.

It is recommended now to follow the new material probably for reasons just like this. I don’t think the older courses will be updated.

1 Like

Thank you for your response. I have many more recommendations to improve the study material that I’ve been noting down to continue sharing, but I don’t think it’s worth sharing them if, based on what you say, it seems you are going to focus on the new Full Stack curriculum material and you don’t believe the previous courses will be updated. I’m glad to know that the Full Stack curriculum is much more polished. What you do here at freeCodeCamp seems incredible to me.

yes, the archived coursework is not going to get substantial updates, but if you have suggestions at the step level, those we may implement

Note, a regex is not in any way needed to complete this.

Yes, you’re right, but I don’t understand the point of making it more complicated when they could have added, at most, two more steps in the Learn Form Validation by Building a Calorie Counter course, where regex is taught, and given someone who is learning the possibility of solving it in a more direct and faster way with regex.

I was only commenting that the project does not require the use of a regex

1 Like

Yes, you’re right, I hadn’t fully understood your answer.