Functional Programming: Apply Functional Programming to Convert Strings to URL Slugs : Global Varible error

Couldn’t pass test case:- **The globalTitle variable should not change.

In my code below I have check globalTitle variable is not changing at any stage, please help!

Question Link:

// The global variable
const globalTitle =" Winter Is  Coming";


// Only change code below this line
function urlSlug(title) {
var t2=title;
t2= t2.toLowerCase();


var r=t2.join('-');

{return r.slice(1,r.length);}

  return r;

// Only change code above this line

Hello there,

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.

Thank you.

To answer your question:

Your globalTitle has been changed. Copy the code you want to keep, then reset the challenge.

Hope this helps

Thanks for moving the post!

How globalTitle has been changed?

What it is supposed to be:

var globalTitle = "Winter Is Coming";
1 Like

when there is a line like this, and you do not respect it, you could fail tests for that reason

next time you can test by creating a new function call…

1 Like

Thanks @ilenia and @Sky020