explaingit

lydiahallie/javascript-questions

65,327Audience · developerComplexity · 1/5StaleLicenseSetup · easy

TLDR

A collection of 100+ JavaScript quiz questions with detailed explanations, covering beginner to advanced concepts like hoisting, closures, and this binding to prepare for interviews and deepen language understanding.

Mindmap

mindmap
  root((repo))
    What it does
      Quiz questions
      Multiple choice
      Detailed answers
    Topics covered
      Hoisting
      Closures
      This binding
      Scope rules
    Use cases
      Interview prep
      Self-testing
      Learn quirks
    Format
      Markdown only
      No installation
      GitHub native
    Audience reach
      20+ languages
      Beginners to advanced
      Global community

Things people build with this

USE CASE 1

Prepare for JavaScript technical interviews by practicing tricky questions on hoisting, closures, and scope.

USE CASE 2

Test your understanding of JavaScript edge cases and language quirks you may have overlooked.

USE CASE 3

Study foundational JavaScript concepts with detailed explanations of why code behaves a certain way.

Tech stack

JavaScriptMarkdown

Getting it running

Difficulty · easy Time to first run · 5min
Use freely for any purpose including commercial, as long as you keep the copyright notice.

In plain English

This repository is a large collection of JavaScript quiz questions ranging from beginner to advanced level, each accompanied by a detailed explanation of the correct answer. The problem it addresses is the gap between knowing JavaScript syntax and truly understanding how the language behaves, particularly in tricky edge cases that often appear in technical job interviews. Each question presents a short code snippet and asks what output it produces or what happens when it runs, then offers multiple-choice options. Clicking the collapsed answer section reveals not just which option is correct but a thorough plain-English explanation of the underlying JavaScript concept, things like variable hoisting, how var and let differ in loops, how arrow functions handle the this keyword differently from regular functions, how closures capture scope, and many more subtle behaviors. The repository was created in 2019 and the README notes that the questions reflect JavaScript as it existed at that time, so some very recent language features may not be covered. However the core language behaviors explained are foundational and still relevant. You would use this to prepare for JavaScript coding interviews, to sharpen your understanding of language quirks you may have glossed over, or simply as a self-testing study tool. It is available in over twenty translated languages, making it accessible to a global audience. There is no code to install or run, it is entirely a Markdown document read directly on GitHub.

Copy-paste prompts

Prompt 1
I'm preparing for a JavaScript interview. Give me a tricky question about hoisting or closures and explain the answer like I'm learning it for the first time.
Prompt 2
Show me a JavaScript code snippet that demonstrates how var and let behave differently in loops, and explain why.
Prompt 3
Create a quiz question about how arrow functions handle 'this' differently from regular functions, with a detailed explanation.
Prompt 4
I want to understand JavaScript scope better. Give me a closure example that shows how inner functions capture variables from outer scope.
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.