what’s happening:
My solution seems to return the correct string exactly like the conditions say it should, but it’s saying I got it wrong.
code so far
// Only change code below this line
function urlSlug(title) {
return title.trim().toLowerCase().split(" ").join("-")
}
// Only change code above this line
urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone");
Is telling me:
urlSlug(" Winter Is Coming")
should return the stringwinter-is-coming
.
But it does return exactly that. What gives?
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36
Challenge: Apply Functional Programming to Convert Strings to URL Slugs
Link to the challenge: