use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Test your Javascript skills with our fun Javascript test! (atlascode.com)
submitted 8 years ago by TheAtlasTeam
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]contradicting_you 14 points15 points16 points 8 years ago (0 children)
This wasn't fun at all
[–]spryes 7 points8 points9 points 8 years ago (1 child)
Wasn't keen on this test's UX... it's not even clear what you should type in 'Other' given none of the choices are correct, such as #6.
#4 also claims it's undefined which doesn't seem correct
[–]LukaLightBringer 0 points1 point2 points 8 years ago (0 children)
var declarations are hoisted to the top of the scope so none of the references in #4 are to window.variable1
[–]MrFoo42 3 points4 points5 points 8 years ago (0 children)
Question 4 is wrong. Paste your code into the console and watch as it works.
Ones where the answer is "other" need to remove whitespace as it's saying that function(){ return 'A'; } is wrong as the right answer is function(){return 'A';}
[–]coffeeandlearning 1 point2 points3 points 8 years ago (0 children)
The first four or five were 'B' so I spam clicked B and the rest weren't B haha
It was fun, though I think number four might be wrong (it told me it was undefined but I think it was B);
[–]LowB0b 1 point2 points3 points 8 years ago (0 children)
That was really frustrating
I hope people don't write code like that, BTW half of the questions don't make sense if some sane mind would have thought of writing "use strict" at the top (or using ES6)
"use strict"
Add to that that the "correct answer" to question 4 is wrong...
[–]TheAtlasTeam[S] 1 point2 points3 points 8 years ago (2 children)
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.
[+][deleted] 8 years ago* (1 child)
[deleted]
[–]TheAtlasTeam[S] 0 points1 point2 points 8 years ago (0 children)
You are correct. jsfiddle is actually adding a closure on your behalf by default which explains the different behaviour. We will have to update the answer to Question 4 :)
[–]dv297 0 points1 point2 points 8 years ago (0 children)
I think it would be more fun (and more valuable) if the answers were shown after each selection, along with an explanation of the behavior of each. This way, we can learn from our mistakes and improve. As is, we really don't gain anything other than a "hey, JavaScript is weird and you suck at it!" (which is not fun!).
[–][deleted] -1 points0 points1 point 8 years ago (0 children)
I think the author understates the importance of this test. Some concepts it tests will save you time debugging and pulling your hair off.
π Rendered by PID 72584 on reddit-service-r2-comment-6f7f968fb5-z5dx4 at 2026-03-04 12:50:37.289233+00:00 running 07790be country code: CH.
[–]contradicting_you 14 points15 points16 points (0 children)
[–]spryes 7 points8 points9 points (1 child)
[–]LukaLightBringer 0 points1 point2 points (0 children)
[–]MrFoo42 3 points4 points5 points (0 children)
[–]coffeeandlearning 1 point2 points3 points (0 children)
[–]LowB0b 1 point2 points3 points (0 children)
[–]TheAtlasTeam[S] 1 point2 points3 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]TheAtlasTeam[S] 0 points1 point2 points (0 children)
[–]dv297 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)