Palindrome Checker Project ignoring user input

There are several techniques you were taught that can be used to this purpose.

you should review the JavaScript Algorithms and Data Structures certification, or you should work thorugh the Certified Full Stack Developer Curriculum

You should not look through Responsive Web Design to review how to work with strings

Did you work through the projects leading up to this one? The Calorie Counter project covers basic regular expressions, but the coverage of regular expressions in the Certified Full Stack Developer curriculum is much, much better.

You also don’t need regex to do this.

Yes. I agree, but use of a regular expression in this project is so much cleaner. And something we should all try to get our heads around.

Ehh, I dunno about cleaner. I think character codes are perfectly ‘clean’. But practicing regex is good every though it’s a relatively infrequently used tool for most devs.

You two (Jeremy LT and ILM) have me confused but potentially I have not come across clearly as well. I seems to the logical way to convert for example 0_0 (: /-\ :slight_smile: 0-0 to 0000 is by a replace method. I was intending to ask where is the course it mentioned how to by this method remove non-alphanumeric values. You appear to suggest while you can do it this way that was not the way you were taught in the course. I have more to say but struggling for the words.

No matter which course you’ve taken, there exists sufficient content to allow you to complete this project

However looked through all the programs I cannot find that way.
Based my experience so far The stack developer course (javaScript) is really drawn out for those with knowledge of other programming languages. The Responsive web design (Javascript) jumps to complicated programs quickly and cover a vast amount of information before a certification project.

Last message was sent in a stressed mindset. I am going to leave javaScript for the day and have another look at programs on Monday or later to see if I can find this other and intended way.

There is no single ‘right’ way to solve this project. There are many valid ways to solve it. The previous projects aren’t intended to give you something to closely replicate here but rather give you tools you can use to make a solution here.

Yes but they will give me commands to combine. At the moment I cannot remember any other way non-regex way to do it except a very longwinded way with if loops.

If statements and for loops are powerful. Don’t dismiss them prematurely. They are valid and can help you express your logic before you find a shorter syntax to do the same thing.

For clarity I meant if statements not loops. For a long time I managed believe if was a type of loop I have long since been corrected on this but given how long was mistaken I managed to accidently write if loop. Anyway this approach would not work anyway as it assuming remove each character individually. It project description itself, and possibly from what you and ILM have said, there is a way to remove all non alphanumeric characters in one go, taught in the course. I am just about to do the read over, I referred to, to try and find out.

Where did I say such a thing?

not exactly, there are different ways to remove all non alphanumeric characters, not necessarily in one go, and you should be able to put together at least one of them with what you have learned so far

or not necessarily remove but at least not consider, that is also a possiblity

Let’s say you create a function to clean the input string. That function would only need one line of code if you used a basic regular expression, as opposed to several lines of code to loop over the string characters and decide what you want to keep. So, if by “in one go” you mean returning a clean input value from a function, either approach would satisfy your goal, right? And I think that’s the point that Jeremy and ILM are trying to make.

1 Like

By one go I mean not mentioning each non alpha-numeric value individually and potentially for readability in multiple commands not the whole process taking multiple commands.
I know realise one approach is do opposite look instead for alpha-numeric values and also I may be able to improve readability by making an array of these.
I also get the impression from Jeremy hearting this post, regular expressions can be used just not the way I originally thought. I was unsure prior to this if regular expression were not meant to be used for project. Knowing this I am no longer questioning if, bringing them up at this point of course is advisable. I know not everything already covered is or should be covered project but given how it confused me (and I am sure others) I wondered if, it was better to not bring regular expression up at this time. I have broadly changed my mind now.

@Malcolm-Harrison Hi, this thread has gotten really long and I believe the original problem was solved. For someone to get familiar with the discussion here involves reading a lot of material that’s no longer relevant.

I’ve marked what I think was the solution and I’ll close this thread. If you still need help can you please open a new thread and post the latest version of your code?

I just want to summarize some points here:

You may use any loops or logic that you want to remove special characters, although I do think most programmers would opt for regex.

Regex is introduced before this task in the new Full Stack curriculum. I would suggest moving to the new Full Stack curriculum and not continuing this older material.

I feel ILM or Jeremy are better placed to close this post as I feel like you have potentially misunderstood some of what they said. I struggling to explain exactly what this is but relates to regex.