Skills101
← All practice quizzes

Quiz: Classes, Modules, Map and Set

5 questions · new set on every retakeNo time limitPass: 60%+10 XP on first pass

Write organised JavaScript the modern way. Classes with constructors, getters, static and private fields, inheritance with extends and super, splitting code into ES modules with import and export, and when to use Map and Set.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    What does this print?

    class Box {
      constructor(n) { this.n = n; }
      get double() { return this.n * 2; }
    }
    console.log(new Box(21).double);
    
  2. Question 2

    What does this print?

    class A { hi() { return "A"; } }
    class B extends A { hi() { return "B" + super.hi(); } }
    console.log(new B().hi());
    
  3. Question 3

    What does this print?

    console.log(new Set([3, 1, 3, 2, 1]).size);
    
  4. Question 4

    What is special about a field written as #balance inside a class?

  5. Question 5

    Where does a static method live?

🎯 Today’s placement challenge — 10 questions, no login. Can you score 10/10?Take today’s challenge →