Reusable Input Cleanup
Reusable Input Cleanup
A reusable JavaScript function should clean the input it receives and return the new value instead of depending on one outer variable.
Your task: Write normalizeUsername(input) so it returns a username with surrounding whitespace removed and letters lowercased.
Free with a JS Exercises account
Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.
By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.
Reusable Input Cleanup
A reusable JavaScript function should clean the input it receives and return the new value instead of depending on one outer variable.
Your task: Write normalizeUsername(input) so it returns a username with surrounding whitespace removed and letters lowercased.