It seems like my code contains all the rules of the task, but for some reason the tester does not let me go to the next lesson.
Your code so far
// Only change code below this line
function urlSlug(title) {
return title.toLowerCase().trim().split(/\W/).join("-");
}
console.log(urlSlug(" Winter Is coming"));
// Only change code above this line
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.192 Safari/537.36.
Challenge: Apply Functional Programming to Convert Strings to URL Slugs
I would recommend you use console.log to see what your function is returning each time so you know where the problem is. Then once you figure that out you should be able to tell what needs to be fixed.
Hint: It can be fixed with the addition of one character to the code you already have.
Thanks for the advice, I do just that, I also realized that if I add β+β to the split parameters (/ \W +/), then the exercise is performed. I do not understand why the exercise is not performed without β+β, what exactly this β+β affects, because without it I do not break any rule in the given task