JavaScript Q&A - Extend Your Knowledge
Written by Ian Elliot   
Tuesday, 02 July 2019

A set of multiple choice JavaScript questions to test (and expand) your knowledge is available on GitHub. The questions range from basic to advanced.

The questions are posted daily on Instagram by Lydia Hallie, who describes herself as a 21 year old software developer in React, Node, GraphQL, and AWS. The idea is that the questions let you test how well you know JavaScript, help you refresh your knowledge a bit, or prepare for your coding interview.


Once a week the GitHub repo is updated with that week's questions. Each question takes the form of a question showing some code, four multiple choice possible answers, and the answer hidden in a collapsed section below the question.

So, for example, one of this week's questions asks:

What's the output of:

function sayHi() {

  var name = "Lydia";
  let age = 21;
And gives you choices of possible answers of:
  • A: Lydia and undefined
  • B: Lydia and ReferenceError
  • C: ReferenceError and 21
  • D: undefined and ReferenceError

The answers are more than just what the correct choice was; in the case of the question above, Hallie says:

Answer: D


Within the function, we first declare the name variable with the var keyword. This means that the variable gets hoisted (memory space is set up during the creation phase) with the default value of undefined, until we actually get to the line where we define the variable. We haven't defined the variable yet on the line where we try to log the name variable, so it still holds the value of undefined.

Variables with the let keyword (and const) are hoisted, but unlike var, don't get initialized. They are not accessible before the line we declare (initialize) them. This is called the "temporal dead zone". When we try to access the variables before they are declared, JavaScript throws a ReferenceError.

It's a fun read if you want to stretch your brain and keep your JavaScript skills current.



More Information

JavaScript Questions On GitHub

Related Articles

Jobs Need More Than JavaScript

Homepage For JavaScript Standards Launched

Top 10 JavaScript Errors

JavaScript Puzzle - The Too Tidy Assignment

The Confusing Comma In JavaScript 


To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, Facebook or Linkedin.


Over 1 Million Enrollments For Intro To Linux on edX

The Linux Foundation has announced that its Introduction to Linux training course, currently in its sixth edition on edX, has had over one million enrollments. This course was the first [ ... ]

Lightstep Adds New GitHub Action

Lightstep has announced a new GitHub action, Lightstep Pre-Deploy Check, designed to help developers be proactive about ensuring the quality and performance of their software before it’s actually de [ ... ]

More News





or email your comment to:





Last Updated ( Tuesday, 02 July 2019 )