Please help me figure this out

please help. still very new to Javascript. coding in general.

the initial code had double spacing both before and after the string ‘remove whitespace’, so i removed it using the .trim method. still comes up as incorrect.
the code:
console.log(‘Remove whitespace’ .trim());

what am i doing wrong?

Hi @Andicodes !

It would help if you shared your code so people can better assist you.

Is this a freecodecamp challenge?

1 Like

trying to figure that out, sorry. is there a specific place/way to write my code so that it’s visible on the profile? other than just simply typing it in, as i did above?

Here is how to write your code into the forum.

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

1 Like

I noticed one thing when I placed it in a code editor.

Make sure to turn off smart quotes.
Programming uses straight quotes like these ""

Your code should be this.

console.log("Remove whitespace".trim());

instead of this

console.log(‘Remove whitespace’ .trim());

thank you so much for this! i finally figured it out. instead of manually removing the space myself, i just had to use .trim and it did the rest :slight_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.