📄Serialization
Also known as Serialisation, Serialize, Deserialization, Marshalling
Turning data into text or bytes to save or send. Reading it back builds it again.
Think of it like
Think of it like packing a toy flat in a box to post it. Your friend opens it and builds it again.
Example
Jack's game saves the player's level and score as JSON. Next time, it reads the file and puts the player back where they were.
Why it matters
Memory is wiped when a program stops. This is how data lasts, and how it moves between programs.
Definition
Example code
javascript
JSON.stringify({ name: "Emma", age: 36 })
// '{"name":"Emma","age":36}'Common mistake
Key takeaways
- 1Memory to bytes. Data becomes text or bytes.
- 2Both ways. Reading it back is called deserialization.
- 3Agree on a format. The sender and the reader must match.