Run the Tests button not working in Chrome or Firefox

Yet again, the Run the Tests button won’t work. Only this time it won’t work in either Chrome or Firefox. No ticks or crosses to indicate what I got right or wrong.

What is going on?

Sometimes when there are certain types of syntax errors in your solution, they can prevent the tests from fully executing. Your devtools console might give you enough information to find the error, or you can share your code here (along with a link to the challenge) and we’ll try to help.

Challenge: Using Objects for Lookups

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/using-objects-for-lookups/

My code:

// Setup
function phoneticLookup(val) {
  var result = "";

  // Only change code below this line
  var lookup = {
    1: "alpha": 
      result = "Adams";
      break;
    2: "bravo": 
      result = "Boston";
      break;
    3: "charlie": 
      result = "Chicago";
      break;
    4: "delta": 
      result = "Denver";
      break;
    5: "echo": 
      result = "Easy";
      break;
    6: "foxtrot": 
      result = "Frank";
  }

  // Only change code above this line
  return result;
}

// Change this value to test
phoneticLookup("charlie");

Hi there,
The test button seems to have bouts of working and then not working (i.e. staying on “running tests”)
Here is what I did that worked for me (at least this time).

  1. First check your code works elsewhere. I assume you did this already
    1a. Cut and paste the code chrome developer tools to first verify no problem there.

  2. Find out what FCC can’t load in your browser developer tools
    2.a Once I see my code actually works fine. Then I go back to the test with the developer tools open and hit the run button.
    2b… In this case I was able to see that some jquery file from some cdn site was not loading. It was loading fine a few hours ago today. The only thing I did was update Chrome!!! However I seem to remember it working fine even after this. Not sure though.

  3. Is this some extension problem again???
    a… I have ad blockers and privacy checkers, etc. installed with no problem previously:
    ABP, Ghostery, PrivacyBadger.
    b. I temporary disabled or paused all of this to see if I can get the run button working and it worked!
    c. . I then one by one enabled/unpause each extension to find the culrpit (i.e. can modify my ghostery, or privacy badger setting to be less strict for this page, etc?)

  4. Results for me this time:
    a. Turns out for me I could keep my Ghostery blocking everything, my Privacy Badger as is, BUT I had to disable my ABP for the site to get the test button to work and proceed with tests. I DID NOT have to do this previously today. However, since I got all the other back enabled, I figure no big deal for now.

1 Like

I’m on Step 1. I have no idea what I’m doing.

@QuincyLarson must know about this.

You want to switch to your Console view. You are looking at “Elements” in the picture. That just shows the HTML makeup. Switch to Console tab next to it. Then you can copy your code there and press Return Untitled

If you code works there. Then, keeping the console here open, press your (2) “Run Test” button and the same answer should appear as before. If not, then something will undoubtly appear in red saying, stating the exception or what couldn’t be loaded. Hope that helps a little better

I appreciate your efforts to help me. Unfortunately I can’t copy to the console because the console is displaying a very long list of errors, although I spotted a syntax error.

The first 7 lines in red are describing your error and where it is.

I’ve changed the code. The last two tests were the only ones that passed:

You should not modify the return statement
You should not use case, switch or if statements

// Setup
function phoneticLookup(val) {
  var result = "";

  // Only change code below this line
  var lookup = {
    1: "alpha",
    2: "beta",
    3: "charlie",
    4: "delta",
    5: "echo",
    6: "foxtrot"
  };

  // Only change code above this line
  return result;
}

// Change this value to test
phoneticLookup("charlie");

Your code always returns an empty string. The lookup object is never used.

Also,

You can clear that the console and paste. Actually, you should be able to paste beneath it. just scroll a little and look for the “>” prompt and paste there. You can also clear the console. Just press the circle with the slash between it. It clears the console. until the next input comes in. It’s under the “Elements” listing, to the left of the “top” text. .

Hi there. I’ve cracked this. Thank you all for your help.