- Executors
-
Learn
Learn Python Runnable examples, NumPy, pandas, and more Learn AI / Machine LearningNeural networks, ML and LLMs from scratch Learn C & C++ Pointers, memory, STL, and modern C++ Learn C#C# basics, OOP, LINQ, async, and .NET exercises Learn MatplotlibLine, bar, scatter and pie charts with live visualizers Learn RustOwnership, traits, error handling, and threads Learn GoSlices, interfaces, goroutines, and channels Python Algorithms Search, sorting, recursion, and visualizers O(n) C & C++ Algorithms Compare algorithms implemented in C and C++ Coding for Kids Learn to code by playing!
- QuizzesNew
- ChallengesNew
- For TeachersNew
- Updates
- Buy me a coffee
JavaScript Map & Set Quiz
Map and Set are JavaScript's built-in collections for key-value pairs and unique values. This quiz checks their basic methods, how keys and duplicates work, iteration order and the differences from plain objects.
Sample question
Question 1 of 10What does this print?
const s = new Set([1, 2, 2, 3, 3, 3]);
console.log(s.size);
Show the answer
D. 3 A Set stores each value only once, so the duplicates are dropped and three values remain. Use size, not length.
What this quiz covers
- Removing duplicates with
Set Mapkeys of any type vs object keys that become stringssize,get,set,hasand iteration- Why objects in a
Setare compared by reference - Turning a
Mapinto JSON
Questions people ask
Do I need an account?
No. Anyone can play. Sign in to keep your XP, streak, badges and history.
Can I retake it?
Yes. Your best score is kept, and the questions and answers are shuffled each time.