Homeโ€บQuizzesโ€บJavaScript Basics Quiz

JavaScript Basics Quiz

Developer Quiz

Test your JavaScript knowledge with 12 questions on variables, closures, promises, and array methods. Get your instant score in about 3 minutes.

3 min ยท 12 questions

Written by ยท Reviewed by the thecalcu.com team ยท Last updated July 20, 2026

Question 1 of 12

What keyword declares a block-scoped variable that can be reassigned in JavaScript?

JavaScript runs in every browser and increasingly on servers too, but foundational concepts like closures, hoisting, and the difference between == and === trip up developers at every experience level. This 12-question quiz checks your grasp of these fundamentals. It takes about 3 minutes, with an explanation after every answer.

Once you've tested your knowledge, clean up JSON data with the JSON Formatter, or test a regex pattern with the Regex Validator before dropping it into your code.

Frequently Asked Questions

How is my score calculated?

Each of the 12 questions has exactly one correct answer, and your final score is the number you got right out of 12. There's no partial credit, so read each option carefully.

Is my quiz result saved anywhere?

No. The quiz runs entirely in your browser and nothing is sent to a server or stored. Refreshing the page resets your progress.

Do I need to already know JavaScript to take this quiz?

Some familiarity helps, but the questions cover foundational concepts โ€” variables, equality checks, array methods, closures โ€” that are commonly taught early on, with explanations written to be understandable even if a concept is new to you.

Why does `typeof null` return "object" if null isn't an object?

It's a long-standing quirk baked into JavaScript's original implementation decades ago. Fixing it now would break too much existing code, so it remains a well-known exception developers just have to memorize.

How do I check or format JSON while working with JavaScript?

The [JSON Formatter](/json-formatter/) reformats minified or messy JSON with proper indentation, which is useful when debugging API responses or config files.

How do I test a regex pattern before using it in my code?

The [Regex Validator](/regex-validator/) lets you test a pattern against sample strings and see exactly what it matches, which is faster than guessing and re-running your script repeatedly.

What's the practical difference between map() and filter()?

map() transforms every element and returns a new array of the same length, while filter() selects a subset of elements based on a condition and returns a potentially shorter array. They're often chained together in real code.

Can I retake this quiz?

Yes, any time โ€” the questions stay the same, so it's a good way to confirm foundational concepts like closures and hoisting have actually stuck.