Tell us what’s happening:
I cannot pass one more test (result should equal to “Hello, World!”)
I tried many ways to solve this problem and read forums related to this challenge. I also tested on regex101 website. Stuck this problem nearly 2 hours by now.
Your code so far
let hello = " Hello, World! ";
let wsRegex = /^\s+|\s+$/g; // Change this line
let result = wsRegex.test(hello); // Change this line
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36
.
Challenge: Remove Whitespace from Start and End
Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end