Build a String Formatter - Step 4

Tell us what’s happening:

let cleanedInput = “userInput.trim()”;
Because the expression is inside quotes, it becomes a literal string instead of actually trimming the value of userInput. The function trim() never runs. It should be:

javascript
Copy code

 [mod edit - solution removed]

So the issue is that the code is treating the expression as a string instead of executing it.”

Your code so far

js

// User Editable Region

let cleanedInput ="userInput.trim()

// 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/142.0.0.0 Safari/537.36

Challenge Information:

Build a String Formatter - Step 4

Not exactly treating the expression as string. "userInput.trim()" is a string, userInput.trim() is not.

The instructions have not in any way asked to create a string with a value “userInput.trim()”

They are clear in asking for the trim method to be used on a variable that contains a string.

Please don’t post solutions.