- 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 JSON Quiz
This JavaScript quiz checks the everyday use of JSON.stringify() and JSON.parse(). You will predict the JSON text for common values, see which values are dropped or changed, and spot invalid JSON.
Sample question
Question 1 of 10What does this print?
console.log(JSON.stringify({ a: 1, b: "x" }));
Show the answer
B. {"a":1,"b":"x"} JSON.stringify() returns compact JSON text: keys in double quotes, numbers unquoted, no spaces. [object Object] is what String(obj) would give.
What this quiz covers
JSON.stringify()output for objects and arrays- What happens to
undefined, functions,NaNand dates JSON.parse()and the strict JSON syntax- Picking keys with a replacer and customizing with
toJSON() - Circular references
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.