I have tried a couple of ways but couldn’t pass my code, I hope my understanding of regex is correct, even so had used alternative measures to directly convert the mobiles to a regex function just so to be sure, I need help with pls.
Please don’t spam other people’s threads. Any response posted to a thread should be either in reply to the OP’s question or to support the original topic in some way.
we can’t write the code for you so please provide more information on what it is you need help with.
If you need to make sure your regex is working then use this website:
(set the ‘flavor’ option on the left side of the page to “ECMAScript” in order for the regex to be parsed with a javascript engine)
You write your regex in the top Regular Expression input area (the symbols between the left and right slash) and then write the test strings to see if it will match them or not
Thank you for your feedback, it certainly was helpful to crosscheck with my regex , however i have attempted to implement the code task in a number of ways. i think my current function verify, should test all mobile number input and sort a result with a textContent value. The function seems not to implement the task requested of it.
I have not done any testing or debugging with the function of mention, save for the fact that i can’t pass the code.
i thought of doing it over after understanding regex a little better, yet not pass.
update provided below:
this is a certification project so you’ll need to do some testing and figure out if your code works or not yourself before relying on the test suite.
When posting on the forum, we do expect you to have done that at a minimum and to be able to show your thinking in terms of what issues you’ve encountered and what you’ve tried to solve them.
You should be passing a reference to a function to the addEventListener here.
(you should not call the function as that will invoke it before the actual event happens)
Also I notice that this line of code is sitting inside the verify function itself, so that verify(str) calls verify(str). Did you mean to make it recursive like that?
Thank you for your feeback, at this stage things are a bit foggy, i confuse reference for a recursive function, if the function is the event intend the code to run, cant it be passed as so, or i declare the eventlisterner outside the scope of the function then followed by the function?
if you’re unsure about the usage of something, you should try to look it up.
there are multiple places to help you with that online (you could for example google: how to add an event listener on a button in javascript) or you could click on the last step of one of the projects you’ve done in fcc (like the decimal to binary converter maybe?) and read the code to recall how they wrote the event listeners.
recursion is when a function calls itself. I don’t think you wanted to do that here unless you planned it in your algorithm.