BeginnerCoder

Lesson 6 — Working with JSON

Round trip: object → text → object

To send data over the network or save it in a file, you serialize it — turn it into text — with JSON.stringify. The other side deserializes it back with JSON.parse. Numbers, strings, arrays and nested objects all survive the trip.

JSON.stringify({ a: 1 });   // '{"a":1}'

Why it matters: this round trip happens on every API call and every config file your server reads.

Want it another way?
Task

Turn the order into text with JSON.stringify, log it, then parse it back and log the first item.

Run your code — when the output matches the task, you will see a green check. Then mark the lesson complete.

← Back
Next →
Test your knowledge

A quick 3-question quiz on this lesson — instant feedback.

Enjoying this lesson? Share it.