This is my proposed solution for the FCC challenge: Remove Whitespace from start and end.
let hello = " Hello, World! ";
let wsRegex = /(?!=\s+)(?:\w+\D\s\w+\D)(?!=\s+)/; // Change this line
let result = hello.match(wsRegex); // Change this line
What I mean is that the result should not be a string. And that is satisfied. The input given is exactly the same as the one above. And also the output is desired output. Also the index where the string is found is correct too. I don’t see any mistake in this.