Student-friendly HTML, CSS, and JavaScript reference with examples
Converts a JavaScript object to a JSON string for sending to servers.
const user = { name: 'Alice', age: 25 };
const jsonString = JSON.stringify(user);
// jsonString is '{"name":"Alice","age":25}'
When to use:
fetch() POST requests