JavaScript-Quiz: JSON

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.

Leicht 10 Fragen ~5 Minuten Bestanden ab 80% Node.js 22

Modus wählen

Du spielst als Gast: Melde dich an, damit XP und Serie gespeichert werden.

Beispielfrage

Frage 1 von 10

What does this print?

console.log(JSON.stringify({ a: 1, b: "x" }));
Lösung zeigen

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.

Darum geht es in diesem Quiz

  • JSON.stringify() output for objects and arrays
  • What happens to undefined, functions, NaN and dates
  • JSON.parse() and the strict JSON syntax
  • Picking keys with a replacer and customizing with toJSON()
  • Circular references

Häufige Fragen

Brauche ich ein Konto?

Nein. Jeder kann spielen. Mit Anmeldung werden XP, Serie, Abzeichen und Verlauf gespeichert.

Kann ich es wiederholen?

Ja. Dein Bestwert bleibt erhalten, und Fragen und Antworten werden jedes Mal neu gemischt.