Functional Programming - Apply Functional Programming to Convert Strings to URL Slugs

** urlSlug(" Winter Is Coming") should return the string winter-is-coming**
but my returns it I don’t get where am I stuck

Your code so far

// Only change code below this line
function urlSlug(title) {
  
let a = title.toLowerCase()
a = a.split(" ");
a = a.join(`-`)
return a
}
// Only change code above this line
console.log(urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone"));
console.log(urlSlug("Winter Is Coming"))

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36

Challenge: Functional Programming - Apply Functional Programming to Convert Strings to URL Slugs

Link to the challenge:

You aren’t testing the string with a space in the beginning

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