// Only change code below this line
function urlSlug(title) {
let arr = title.split(" ");
console.log(arr);
let d = arr.reduce((url,a) =>{
return url + a.toLowerCase() + "-";
}, "")
return d.slice(0,d.length-1);
}
console.log(urlSlug(("Winter Is Coming")))
// Only change code above this line
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0.
Challenge: Apply Functional Programming to Convert Strings to URL Slugs
you may want to check what’s the actual output of the tests that fail. Copy that function call and add it inside a console.log() statement as last line of your code