Tell us what’s happening:
Describe your issue in detail here.
Your code so far
// Only change code below this line
function urlSlug(title) {
const newArray = title.split(/\W/);
//console.log(newArray);
const modified = newArray.join("-");
//console.log(modified);
return modified.toLowerCase();
}
// Only change code above this line
//urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone");
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/100.0.4896.127 Safari/537.36
Challenge: Apply Functional Programming to Convert Strings to URL Slugs
Link to the challenge: