I need help removing whitespace

Hello everyone,

My name is Metri, I am new to the community and I aspire to be a successful or at least useful software engineer one day. With that being said, I have an issue implementing the .trim() method. On an exercise for JavaScript I have to remove whitespace from this string.

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

As you can see I appeneded the .trim() method to the end of the string. I am receiving an error when I submit my answer.

On another exercise I had to make the string uppercase.


This code worked and I believe I am implementing this the correct way. Any help would be greatly appreciated.

I want to also add that after asking for the solution it had the same code I had as the answer. How can I avoid this in the future. Is it written correctly.?