Challenge 6 Megathread

Welcome to challenge 6! Use this thread for any and all questions relating to challenge 6.

Is there a bug in one of the test cases?

Failed: The chooseStations function should return the correct vote count.

7 Likes

This challenge is running the tests from challenge 5 when I submit it.

Failed: The chooseStations function should return the correct vote count.

When the function that should be called is

** voterTurnout **

2 Likes

I’m getting the same thing i think its broken

1 Like

here’s the error message for me…
Failed: The chooseStations function should return the correct vote count.

Reason: Your code could not run. “Invalid or unexpected token”

Hint: Make sure you’re omitting the invalid votes.

1 Like

Getting the exact same error despite all my tests passing

1 Like

Running into the same issue. Looks like a test for a different question is being run against this one

1 Like

yes, me too exactly the same error

1 Like

I am also getting this error. Has it been resolved for you yet. My code passes all the tests but when i hit submit I get the same “The chooseStations function should return the correct vote count”.

1 Like

Same here.

Who should we contact about this bug?

1 Like

@Tim-Lighthouse-Labs will you see if this is an error?

Definitely an error. All we can do is wait till it is fixed.

Test code works but submit code doesn’t.

You have 1 Failing Test.

Failed: The chooseStations function should return the correct vote count.
Reason: Your code could not run. “Invalid or unexpected token”
Hint: Make sure you’re omitting the invalid votes.

const voterTurnout = (voter_signatures, voter_ids) => {
  // Code here!

 if (voter_signatures.length !== voter_ids.length) return false;
  
  for (var i = 0 ;  voter_signatures.length < i ; i++){
    
      if(voter_signatures[i] !== voter_ids[i])
    
    return "FRAUD!";
  
    
  }
  
  
  return "All clear, we can count the votes!";
  
};

Don’t pass third test :
Failed: If the signatures do not match the ids the voterTurnout function should return “FRAUD!”.

voter_signatures.length < i
Shouldn’t it be i < voter_signatures.length?

for (var i = 0 ;  voter_signatures.length < i ; i++)

Double check your for loop conditions!

@Bryce and @Garyalwayswins thanks I found my error, I changed for loop and putted i < voter_signatures.lenght
Now it works.

@Tim-Lighthouse-Labs Challenge 6 is obviously broken - any chance we can get someone to run through the rest of them quickly (this should take minutes to do or could even be automated) to make sure that the rest of them work as expected?

1 Like

I am also having the same issue as everyone above :frowning: All my tests pass but when submitting, it says:

Failed: The chooseStations function should return the correct vote count.

Reason: Your code could not run. “Invalid or unexpected token”

Hint: Make sure you’re omitting the invalid votes.

1 Like