Introducing the Javascript Scope Quiz

A few weeks ago, I posted a basic Javascript Scope Quiz to Reddit, HackerNews, and Twitter. I have since realized that there is no real way to find it from the main site here, so I decided to write up a quick post.

The aftermath of this post has actually been quite interesting. I’ve gotten a ton of valuable feedback, including requests that I open source the quiz software, and suggestions that I make a more difficult “Level 2.” I think I’ll probably go about both of these at some point.

As far as viewership goes, as of this writing (9/4/12), the quiz has been viewed just over 15,000 times. While this isn’t stunning in particular (we’ve done better in the past), it has been spread out over a far greater period of time than any of our past posts. This quiz has received hundreds of views everyday since it was posted two weeks ago (including over 1,000 today alone), while our most popular post was far more short-lived, sticking around for only a few days.

Overall, a very interesting experience. I suppose I should get started on that second level right about now …

Eric Jeney is a Java aficionado with a number of projects under his belt. He enjoys programming for the web, and writing about his experiences. He currently studies Computer Science at the University of Maryland.

View all posts by Eric →

  • Tarmo

    “Global Variables 1” doesn’t show in code example that you executed first();

    • Right, but the question itself asks, “Assuming I call these functions in order, what value gets alerted?”

      • Tarmo

        Ahh, true, my eyes somehow skipped that part. Seems, I forgot to read the question and tried to solve it by just looking the code.

  • James Childers

    Ha, was about to say the same exact thing about “Global Variables 1”. Maybe change it to show first() being called?

  • Raarce

    The quiz platform looks awesome! Is this an open platform?

    • Thanks!

      It’s not an open platform at the moment, although a few people have encouraged me to open it up.  I’ll see if I can put some time into getting it into a state where I can put it on Github.

  • This is awesome! Please include some more quizzes and more levels!! 

  • Lauri Rooden

    More tests

    var n = 1;
    function x() {
        var m = n + 1;
        console.log(m);
    }
    x();

    var n = 1;
    function x() {
        var n = n + 1;
        console.log(n);
    }
    x();

    var n = 1;
    function x(){
       console.log( n );
       var n = 2;
    }
    x();

  • Farhan Dharsi

    where is the download link?

  • Farhan Dharsi

    hello can you send me this script?