Trying the functional programming portion of the JS Certificate.
function urlSlug(title) {
return title.toLowerCase().split(/\s+/).filter(String).join("-");
}
This is not working. Keeps telling me:
The globalTitle variable should not change.
But doesn’t toLowerCase()
give back a new string?