Tell us what’s happening:
global variable is not changing in the console, but it keeps on telling me that it is changing, I’ve tried searching similar topics, but no use. is this a problem with the freeCodeCamp itself?
Your code so far
// the global variable
var globalTitle = " Winter Is Coming";
// Add your code below this line
function urlSlug(title) {
//return title.split(/\W/).filter(x => x!="").join("-").toLowerCase();
return title.split(/\W/).filter((obj)=>{
return obj !=='';
}).join('-').toLowerCase();
}
// Add your code above this line
var winterComing = urlSlug(globalTitle); // Should be "winter-is-coming"
console.log(winterComing);
console.log(globalTitle);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
.