r/javascript • u/TheAtlasTeam • Aug 09 '17
Test your Javascript skills with our fun Javascript test!
https://www.atlascode.com/blog/test-your-javascript-skills-with-our-fun-javascript-test/
1
Upvotes
r/javascript • u/TheAtlasTeam • Aug 09 '17
2
u/TheAtlasTeam Aug 10 '17
Hi Everyone,
Thanks for taking the test, I'm glad it has piqued your interest and I hope you found it as fun to take as I found it writing it.
The answer to question 4 is in fact undefined. @LukaLightBringer correctly points out that this question is designed to show the results of hoisting. Unfortunately chrome's developer console has undergone some changes in the last few months which mean that it no longer hoists variable declarations like it should. You can see the results of hoisting in question 4 if you run the script in the page rather than the console like in this fiddle. Here you will see undefined correctly being reported in the console.
Of course, we don't expect anyone to actually write javascript like the questions in the test. In fact we hope you don't! The test is designed to highlight some of the oddities of javascript and things that may catch you out.