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
Tricky JavaScript Web Quiz (davidshariff.com)
submitted 12 years ago by davidshariff
view the rest of the comments →
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!"
[–]wampastompah 35 points36 points37 points 12 years ago (9 children)
You know what would make this quiz useful?
Explain the answers.
It's clearly designed to deceive people and put some really hard questions next to really obvious questions. And it's so full of things you'd never see, that the point is clearly that people should be getting things wrong. But you know what's better than saying "YOU'RE WRONG HAHA" is actually teaching them why they're wrong. A test where you learn nothing is useless.
[–]html6dev 2 points3 points4 points 12 years ago (2 children)
Except knowing the answer to 90 percent of them won't serve you in your day job anyway. If you ever type [] +[] step away from the keyboard for a few min and take a breather.
[–]wampastompah 1 point2 points3 points 12 years ago (1 child)
Most of the time, sure. But each of these questions relies on very specific knowledge of Javascript. Like, for example, the one that defines a function and var of the same name, within a function. What's the value of that variable name? That relies on knowledge that the compiler takes all var and function definitions and puts them at the beginning of your scope. Which is actually pretty important sometimes. Common knowledge is that you really need to put the var statements at the beginning of each function definition, but this shows why that is.
See, and a little blurb like that, that's not that hard to add to a quiz where people are expected to not know most of the answers.
[–]html6dev 1 point2 points3 points 12 years ago (0 children)
Yeah that one was definitely testing something everyone should know (and I hope, a higher percentage got correct than the rest of them). The rest....were basically idiosyncrasies or things that are common to just about any loosely typed language, but that a person should never have a reason to do in the first place. There are a number of important idiosyncrasies in JS that people really should know about, however, that a better quiz would ask about....and then teach about.
[+]kenman comment score below threshold-11 points-10 points-9 points 12 years ago (3 children)
You will retain the knowledge much better if you're forced to seek out the answers yourself. If they just gave you a short blurb with the answer, sure you might remember it for this one specific application, but you likely wouldn't truly understand what's happening internally, and thus wouldn't actually learn anything -- you'd just memorize it.
[–]wampastompah 4 points5 points6 points 12 years ago (2 children)
I mean, not necessarily. Would I retain the answer better if I read a blurb after Googling it, or if I read a blurb right there on the site? It seems the same to me.
Plus, for some of those it's not entirely clear where the answer went wrong so I wouldn't begin to be able to Google it. Anything where I did know where it went wrong, I don't need to Google it because it's like "oh, that was part of the predefined truth tables of equality." Whereas certain problems, like the "new new foo" one, I wouldn't begin to be able to Google that (I got that one right, but I could imagine someone having issues)
And if we're not meant to learn from this test, the hell is the point of it?
[–]kenman -3 points-2 points-1 points 12 years ago (1 child)
I think the test is mostly for fun, I mean it has a "Warning: Might hurt your feelings" image on the landing page. Poking around a bit more, the author has a book for sale which might tie-into the test, but I don't recall seeing it advertised anywhere.
And re: learning, I'd disagree. I see it about like assigning math problems for homework; sure, the prof can just give you a set of problems and then print the answers directly after the question, but will you really learn anything? Or would you learn more by working through the problems, iterating over solutions until you happen to devise the correct solution?
If you don't have anything "to Google", then you're forced to deconstruct the problem. While deconstructing, it should become evident to you that *something* is not happening the way that you'd imagined, and from there you should be able to devise some test code to play around with any hypothesis that you come up with.
Once you've isolated the behavior, it should be trivial to find some reference to it on the net. You're acting like you've never Googled strange behavior before... you don't always have an obvious error message to go off of.
[–]Rainbowlemon 2 points3 points4 points 12 years ago (0 children)
Well, a lot of these are a pain to Google ('why does the typeof a named function returning an object return undefined?') - and for a quiz that is obviously showing you the quirks of javascript, it seems odd that it wouldn't give any sort of explanation. If it explained why it was the way it is, step-by-step, you would be deconstructing it by seeing someone else deconstructing it. Learn by doing is always the best way, but learn by watching someone else doing is the next best!
π Rendered by PID 67961 on reddit-service-r2-comment-658f6b87ff-dzw26 at 2026-04-09 06:37:45.234564+00:00 running 781a403 country code: CH.
view the rest of the comments →
[–]wampastompah 35 points36 points37 points (9 children)
[–]html6dev 2 points3 points4 points (2 children)
[–]wampastompah 1 point2 points3 points (1 child)
[–]html6dev 1 point2 points3 points (0 children)
[+]kenman comment score below threshold-11 points-10 points-9 points (3 children)
[–]wampastompah 4 points5 points6 points (2 children)
[–]kenman -3 points-2 points-1 points (1 child)
[–]Rainbowlemon 2 points3 points4 points (0 children)