// The global variable
const globalTitle =" Winter Is Coming";
console.log(urlSlug(globalTitle));
// Only change code below this line
function urlSlug(title) {
var t2=title;
t2= t2.toLowerCase();
t2=t2.split((/\s+/))
//console.log(t2);
//console.log(t2.join('='));
var r=t2.join('-');
//console.log(globalTitle);
if(r[0]=='-')
{return r.slice(1,r.length);}
else{
return r;
}
}
// Only change code above this line
I have moved this post to a more suitable sub-forum.
If you have a question about a specific challenge as it relates to your written code for that challenge, just click the Ask for Help button located on the challenge. It will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.