Incorrect Challenge Test Case result on Chrome
See original GitHub issueChallenge Name
FEDC -> Basic Javascript -> Nest one Array within Another Array https://www.freecodecamp.com/challenges/nest-one-array-within-another-array
Issue Description
var myArray = [myArray];
is treated as a correct solution. Sometimes it isn’t immediately treated as correct, but upon running tests a second time it is. I haven’t ever had to run tests more than twice to have this treated as correct.
Browser Information
- Browser Name, Google Chrome - Version 54.0.2840.59 (64-bit)
- Operating System: Linux Mint 17.3 Xfce 64-bit
- Mobile, Desktop, or Tablet: Laptop on a desk top.
I did try this bug on a Windows machine with Firefox. It isn’t present. It is present on Chrome however. I’ve used incognito mode in all cases. Windows Chrome version: 54.0.2840.71 m (64-bit)
Your Code
Full challenge code:
// Example
var ourArray = [["the universe", 42], ["everything", 101010]];
// Only change code below this line.
var myArray = [myArray];
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Incorrect Challenge Test Case result on Chrome · Issue #11331
After getting the solution correct, running tests, closing the "You Got It" popup by not continuing to the next challenge, modifying the ...
Read more >reCAPTCHA Help - Google Support
A “CAPTCHA” is a turing test to tell human and bots apart. ... If your answer is incorrect, you will be presented with...
Read more >Frequently asked Questions - Google Online Challenge
This online challenge with a duration of 30 to 60 minutes will include questions that tests the following: · Invalid Passkey: You have...
Read more >Top 7 Challenges Of Cross Browser Testing With Solutions
In this blog, we will explore some common challenges of cross browser testing. Read now to see the top 7 challenges of cross...
Read more >FIX Recaptcha Not Working in Google Chrome [Tutorial]
In this case, the solution is to update Google Chrome to the latest ... that will create this problem with reCaptcha V2 verification....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You would get
[undefined]
, because the lexer hasn’t had a chance to assign anything tomyArray
.Doing the same in my console might explain it better:
If however you do:
It is not a bug with FreeCodeCamp, but a feature(?) of the language.
I hope this clears up the issue.
@erictleung I think you’re right, though it only takes two tries after I’ve already set
myArray
to something like1
and failed the tests. I think that’s because the default linevar myArray = [];
actually already setsmyArray
to[]
before the user has a chance to play with the code.I used
to arbitrary nest
myArray
in the method you suggested. I did notice that each run loggedmyArray
twice, but with 2 different values! The first was the arbitrarily nested array, while the second was always[undefined]
(the keyword undefined). Firefox always returns[undefined]
twice.