🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Classes, Modules, Map and Set: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. What does this print? (code)
  2. Q2. What does this print? (code)
  3. Q3. What does this print? (code)
  4. Q4. What is special about a field written as balance inside a class?
  5. Q5. Where does a static method live?
  6. Q6. In a child class constructor, what must happen before you use this?
  7. Q7. Which import matches export default function formatRupees() {} in price.js?
  8. Q8. Which line is CommonJS rather than an ES module?
  9. Q9. When is a Map a better choice than a plain object?
  10. Q10. What is typeof a class in JavaScript?