Help Convert Strings to URL slugs

Please help me with the error in this solution. I am sure it is a little semantic one.

// the global variable
var globalTitle = "Winter Is Coming";

// Add your code below this line
function urlSlug(title) {
let array = [];
 array = title.split(/\W/);
return array.join('-');
// Add your code above this line

var winterComing = urlSlug(globalTitle); // Should be "winter-is-coming" 

toLowerCase is not an impure function, and strings are immutable anyway.

What I’m trying to say, it’s that you need to re-assign the method-call to title for it to work

title = title.toLowerCase();

also there’s no need to declare the array as empty when you can just do it directly

let array = title.split(/\W/);

also why use that pattern? I believe the challenge only separates by a single space.

Thank you very much!! That was just the help I needed.