Though i get the outuput on all my inputs, still challenge not completed

Tell us what’s happening:

Your code so far


// 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

Link to the challenge:

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

i already did it! thing is i am getting all the outputs correct while doing a console.log.

you are failing this test:

urlSlug(" Winter Is  Coming") should return "winter-is-coming".

if I take that function call and substitute it in yur console.log

console.log(urlSlug(" Winter Is  Coming"))

the console, shows:

[ '', 'Winter', 'Is', '', 'Coming' ]
-winter-is--coming

the second line is from the function call, which is not the required output

that’s not the failing test, try with the failing test