Functional Programming: Apply Functional Programming to Convert Strings to URL Slugs help please

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

// Add your code below this line
function urlSlug(title) {
  let arr = title.toLowerCase().split(" ");
  let result = arr.filter((element) => {
    if (element != "") {
      return true;
    }
  }).join("-");

  return result;  
}
// Add your code above this line

var winterComing = urlSlug(globalTitle); // Should be "winter-is-coming"
console.log(JSON.stringify(winterComing));

I am not able to pass The globalTitle variable should not change. test case. I don’t get it how am I changing globalTItle? How do I fix it.

You added extra spaces to globalTitle