Remove Whitespace from Start and End: HELP

Code doesn’t pass the test:
It prints out Hello, World!
but doesn’t pass the test. I don’t get this. I hope I don’t lose my mind
Your code so far


let hello = "   Hello, World!  ";
let wsRegex = /\S\w*.\s\w+\S/; // Change this line
let result = hello.match(wsRegex)
console.log(result); // Change this line

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15.

Challenge: Remove Whitespace from Start and End

Link to the challenge:

Hi @shagariboy ,

result here is an array, and the string which you need is its first element.
result should be the string.

1 Like

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