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

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

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.
No. The quiz runs entirely in your browser and nothing is sent to a server or stored. Refreshing the page resets your progress.
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.
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.
The [JSON Formatter](/json-formatter/) reformats minified or messy JSON with proper indentation, which is useful when debugging API responses or config files.
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.
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.
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.