Build an Envelope Budget App - Step 24

Tell us what’s happening:

I am stuck on Step 24: Use your regex to replace all instances of +, -, and a space in str with an empty string. Return this value.
I have done that in my .js code and yet I get the error message “You should pass regex as the first argument to replace”. I need help! Thanks!

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region
  return str.replace(/[+\-\s]/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/151.0.0.0 Safari/537.36 Edg/151.0.0.0

Challenge Information:

Build an Envelope Budget App - Step 24

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c0f5.md at main · freeCodeCamp/freeCodeCamp · GitHub

Why aren’t you using the regex variable you’ve been working on in the last few steps?

I am not sure how to do it. I am confused on this step

when you use a variable, you need to write the variable name where you need the value of the variable

Thank you so much!!! That got me pointed in the right direction. I fixed it. :grinning_face: