Apply Functional Programming to Convert Strings to URL Slugs!

Tell us what’s happening:
its saying im not passing the winter-is-coming test case but when i test it myself it looks like im passing
Your code so far


// Only change code below this line
function urlSlug(title) {
let loweredTitle = title.toLowerCase().split(' ')
return loweredTitle.join('-')

}
// Only change code above this line
console.log(urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone"))

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15.

Challenge: Apply Functional Programming to Convert Strings to URL Slugs

Link to the challenge:

you need to check how it works for multiple consecutive spaces, try to see if in that case you get the correct result

i guess i was suppose to filter out that extra space. it passed, but the test cases before i filtered looked identical :man_shrugging:t6:

that one you were failing starts with a space