Skip to content

Guide · Open source

How to use javascript-questions: a guide to the JavaScript quiz

Updated · written with AI from the project's own documentation and checked against our catalogue data

javascript-questions is an MIT-licensed collection of JavaScript quiz questions by Lydia Hallie. Each question shows a short code snippet and asks what it outputs, and the answers and explanations sit in collapsed sections. This guide shows you how to work through it so you can guess first, check second, and learn from the edge cases.

JavaScript Questionslydiahallie/javascript-questions · ★ 65.3k · MIT

Quick start

  1. 1Clone the repo. Run git clone https://github.com/lydiahallie/javascript-questions to get a local copy of the README.
  2. 2Open the README. Read the questions in order or jump to a topic you want to practise.
  3. 3Guess the output. Read each snippet and write down what you think it prints before looking at the options.
  4. 4Expand the answer. Click the collapsed Answer section to see the correct option and the explanation.
  5. 5Test in a console. Run the snippet in your browser console to see how the behaviour changes when you edit it.
  6. 6Revisit tricky ones. Note the questions you got wrong and return to them after a few days.

What the repo contains

The repository is a long list of JavaScript questions in a README file. The README says it covers basic to advanced topics such as hoisting, scope, `this`, type coercion and object references.

Each question is a code snippet followed by answer options. The answer and explanation are hidden in a collapsed section under each question, so you can expand it only after you have made a guess.

Get a copy of the repository

The install method is read-online, and the README lists no prerequisites. If you want a local copy to browse, clone the repository with the command below.

git clone https://github.com/lydiahallie/javascript-questions

How to work through a question

Read the snippet and write down the output you expect before opening the answer. Then expand the collapsed section to compare your guess with the explanation.

The questions are standalone, so you can stop and start at any point. The README notes that the author updates the repo regularly with new questions.

  • Read the code and note any variables, functions and `this` values.
  • Pick an answer from the options listed, or write your own output.
  • Expand the Answer section and read the explanation, even when you were right.
  • Try a variant of the snippet in your own browser console to test the idea.

Focus on the topics that trip people up

The questions often test behaviour that looks simple but is not. Two examples from the README: a `var` variable is hoisted with the value `undefined`, while `let` and `const` throw a `ReferenceError` if read before their declaration; and an arrow function does not get its own `this` from the object it is attached to.

Use the explanations to build a mental model rather than memorising answers, since the same idea appears in different forms.

Keep in mind what the repo does not cover

The README states the repo was created in 2019, so the questions reflect JavaScript syntax and behaviour from that time. Newer language features are not covered. Use it for core behaviour and check current documentation for recent features.

What people use it for

  • Preparing for a JavaScript coding interview by practising tricky output questions.
  • Checking your understanding of hoisting, scope and the `this` keyword after a break from the language.
  • Studying edge cases such as type coercion and object references once you know the basics.
  • Using the questions as a quiz for a study group, since the README allows reuse with a reference to the repo.

Frequently asked questions

Is javascript-questions free to use?

Yes. The repository is licensed under MIT. The README also says you are free to use the questions in a project and asks for a reference to the repo.

How do I install javascript-questions?

There is no installation step as such. The install method is read-online, and you can clone the repository with git clone https://github.com/lydiahallie/javascript-questions if you want a local copy.

What do I need before I start?

The README lists no prerequisites. The questions assume some prior JavaScript knowledge, so complete beginners may find them hard to follow.

Is javascript-questions good for beginners?

Not really. The README describes the questions as covering basic to advanced topics, but they assume you already know the basics. A structured course would suit a complete beginner better.

Does javascript-questions cover modern JavaScript features?

No. The README notes the repo was created in 2019 and the questions reflect syntax and behaviour from that time. Newer language features are not covered.

Are there alternatives to javascript-questions?

The source does not list comparable projects, so this guide cannot recommend specific alternatives. If you need current features or a structured course, check current official JavaScript documentation instead.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

javascript-questions suits developers preparing for interviews, refreshing their knowledge, or studying tricky edge cases in core JavaScript behaviour. It is not suited to complete beginners, people who want current language features, or anyone looking for a structured course, since it is a list of standalone quiz questions.

Install options & downloads