Convert Strings to Url Slugs and more

Tell us what’s happening:

whis is my code not working for passing the challenge?

Your code so far

// The global variable
var globalTitle = "Winter Is Coming";

// Only change code below this line
function urlSlug(title) {

return title.toLowerCase().split(' ').join('-');
// 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/84.0.4147.89 Safari/537.36.

Challenge: Apply Functional Programming to Convert Strings to URL Slugs

Link to the challenge:

Hello there,

Copy-paste the test condition to see why you are failing:

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

Hope this helps

1 Like