Tell us what’s happening:
I don’t know why urlSlug(" Winter Is Coming")
didn’t pass
should return
"winter-is-coming"
.
Your code so far
// The global variable
var globalTitle = "Winter Is Coming";
// Only change code below this line
function urlSlug(title) {
return title.trim().toLowerCase().split(' ').join('-');
}
// Only change code above this line
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36
.
Challenge: Apply Functional Programming to Convert Strings to URL Slugs
Link to the challenge: