Test failing even on correct output

What is the issue with following code? Requirement was to convert “title”
to URL slug, but the test is failing for the input string “Winter Is Coming”.

  **Your code so far**

// Only change code below this line
function urlSlug(title) {
return title.toLowerCase().split(" ").join("-");
// Only change code above this line

console.log(urlSlug("Winter Is Coming"))

Challenge: Apply Functional Programming to Convert Strings to URL Slugs

Link to the challenge:

got it. nevermind!!!

You need to make a little change

notice: urlSlug(" Winter Is Coming")
output: -winter-is-coming
instead of winter-is-coming

Yeah I didn’t notice the space at the start. Thank you.

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