Basic JavaScript - Global vs. Local Scope in Functions

“run the test” doesnt do anything. ive exercised all other options and believe my code is correct but nothing is happening. please help, this happens at least once a day through my freecodecamp life

Your code so far

// Setup
const outerWear = "T-Shirt";

function myOutfit() {
  // Only change code below this line
const outerWear = "sweater";
  // Only change code above this line
  return outerWear;
}

myOutfit();

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14989.107.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Global vs. Local Scope in Functions

Link to the challenge:

When you say doesn't do anything, does it say Running Tests below the Tests section?

Which browser are you using? If it is Safari, there could be a problem with the tests as it may not have some of the latest JavaScript features available to modern browsers such as Chrome and Firefox. Try the same code in Chrome and let us know if the tests pass for you.

when i click on “run the test” absolutely nothing happens. the button changes color when i hover over it, when clicked, nothing happens at all. I have tried to use the shortcut “CTRL + Enter” and nothing happens when trying that too.

You did not answer my question regarding your browser.

sorry, I am on google chrome

Your code passes for me. If you open your the Chrome brower’s console ( Option + ⌘ + J) on your Mac and then click the button, do you see any error messages there. You may have to clear the console first before running the tests. The clear console button looks like image.

Copy/Paste what you see.

sorry for the confusion, Im on a pixelbook using the google chrome browser

Try Ctrl + Shft + J to see if you can get the browser console to show.

Ive attatched a screen capture. If you prefer copy/paste let me know

Can you click the clear button before clicking Run Tests and then show the screenshot again? You may have already done so, but just want to make sure what we are seeing is just related to the button click.

Make sure to disable any 3rd party extensions as they can cause strange errors when working through the curriculum.

after clearing the console and attempting to run the test, this is what im getting. I will check to see if any 3rd party extensions are running.


heres my extensions, unfortunately I cannot disable some of them because I am on a company provided laptop. Should I try on my personal computer?

I was thinking maybe you were using some kind of ad blocker or pop-up blocker extension that might be interfering.

@lasjorg Any thoughts?

Sorry for the late reply.

Sounds more like an issue unrelated to freeCodeCamp. I don’t see it having anything to do with these specific challenge tests as they are just simple string compares.

If the issue was consistent it might be some browser management policies or other restrictions but with it happening intermittently like that it sounds more like a network issue.

When it happens reset the challenge and do a hard refresh Shift + F5 to make sure you are re-downloading everything.

You can also try opening the Network tab in the dev tools and refresh again with it open to see if anything is being blocked. Check the “disable cache” checkbox as well (on the Network tab).

thank you to both of you. It worked after closing the browser completely