Free

Quiz App in JavaScript

Ten hard questions on JavaScript, and an engine that knows nothing about them.

  • JavaScript
  • CSS
  • HTML

About this project

A multiple-choice quiz: one question at a time, immediate feedback with the reason, a progress bar, an optional timer, and a review of everything you got wrong at the end.

The questions are ten real ones about JavaScript — the temporal dead zone, microtask ordering, shallow copies, and why indexOf(NaN) never finds anything. They are not warm-ups, and each one explains itself after you answer.

The design idea is that the data is not the program. script.js is in two parts and the line between them is the whole project: one object holds the quiz and contains no DOM calls at all, while the engine below it knows only eight field names. Read the engine end to end and you will not learn a single fact about JavaScript. That ignorance is the feature — swap the array and you have a history quiz, a Python quiz or a driving-theory quiz, with no other change.

What you will learn

  • Separate data from the program that renders it, so swapping the content changes nothing else
  • Shuffle options without losing track of which one is correct
  • Validate your data at startup and fail with a readable message rather than a blank page
  • Build a per-question timer that cannot leak an interval into the next question
  • Render a review screen that explains the answers rather than just scoring them

Before you start

  • JavaScript basics — arrays, objects and functions
  • A browser and a text editor. Nothing to install.

New to JavaScript? The free JavaScript course covers everything this project assumes.

Academic integrity notice

These projects are provided for learning, experimentation and reference. Understand the code, modify it for your own requirements, and acknowledge external work according to your institution’s academic policies. Priodemy does not supply work to be submitted as your own.