// Why is my private field in the output? // Teaching excerpts; see the explanation and boundaries on the episode page. // Private controls type checking. // Emitted JavaScript class Box { code = "demo"; } // JSON can still see that field. JSON.stringify(new Box()); // {"code":"demo"} // Hash fields stay private at runtime. class Box { #code = "demo"; } JSON.stringify(new Box()); // {} // For server output, pick the fields. const payload = { id: record.id }; JSON.stringify(payload);