Some requests have been made in the tutor prompt, and this is how I perceive the solution to be, whats wrong with it
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
function cleanInputString(str) {
const regex = /[+-\s]/g;
"str".replace(/+-/g);
}
// 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/131.0.0.0 Safari/537.36
Challenge Information:
Learn Form Validation by Building a Calorie Counter - Step 24
no, it’s a regular expression: where do you have a regular expression in the example?
The example is "hello".replace(/l/g, "1");
in your code you need to have the string you need to make changes to in place of "hello", the regular expression that captures the things you need to change in place of /l/g and the string with the new thing to put in the string in place of "1"
You have stored a regular expression pattern /[+-\s]/g in the regex variable in previous step.
Now you need a return statement that returns the parameter str with replace method using dot notation and use the regex variable and an empty string "" separated by a comma within the .replace() method. Your returning statement should be one line of code.
also, you need to put two arguments in the parentehses of replace, one is the regex variable, then you need a second one as described in the instructions