Online admissions open for the SEO, PHP web development and networking & cybersecurity courses. Enquire for the next batch.

JavaScript Quiz: 12 Core Questions

Quiz · 12 questions Updated By the SkillNewton team

This free JavaScript quiz covers the fundamentals that interviewers ask about most: var, let and const scope, == versus ===, truthy and falsy values, array methods, closures, promises and async/await, the event loop, event delegation, this in arrow functions, typeof null and JSON. It suits beginners who have finished an introductory course. Answer all 12 questions, check your score, then read each explanation and revisit the JavaScript guide for weak areas.

Choose one answer for each question, then check your score. Your answers stay in this browser and are not saved.

1. Which statement about var, let and const is true?
2. What happens when this runs? const user = { name: "Asha" }; user.name = "Ravi";
3. What do "5" == 5 and "5" === 5 return?
4. Which of these values is truthy?
5. Which array method returns a new array containing only the items that pass a test?
6. Given function counter() { let c = 0; return () => ++c; } const next = counter(); next(); next(); what does a third call to next() return?
7. In what order does this log? console.log("A"); setTimeout(() => console.log("B"), 0); Promise.resolve().then(() => console.log("C")); console.log("D");
8. What does an async function always return?
9. What is event delegation?
10. How does this behave inside an arrow function?
11. What does typeof null return?
12. Which method converts a JavaScript object into a JSON string?

Frequently asked questions

Which version of JavaScript does this quiz use?

Modern JavaScript (ES2015 and later) as supported by current browsers, including let, const, arrow functions, promises and async/await.

How can I check the answers myself?

Open your browser's developer tools, go to the Console tab and paste in the code from a question to see the result.

What should I learn after these basics?

Practise DOM manipulation and fetching data from APIs, then learn a back-end language such as PHP to build complete web applications.

Want to Learn This Properly?

The PHP Web Development: Foundation & Practical Implementation (Online) turns resources like this into practised skills, with projects on real websites.

WhatsApp Call Us Now

Free counselling

Send an Enquiry

Tell us which course you are interested in. We reply by email or phone with the next batch and how to enrol.

We reply by email or phone within working hours. No spam.