My solution to this challange:
// the global variable
var globalTitle = "Winter Is Coming";
// Add your code below this line
function urlSlug(title) {
return globalTitle.split(" ").map(val =>; val.toLowerCase()).join("-");
}
// Add your code above this line
var winterComing = urlSlug(globalTitle); // Should be "winter-is-coming"
Can anybody tell me what is wrong with my code? I’ve tested it in the Chrome’s console and it works just fine.