JSON.stringify()

A method that converts a supported JavaScript value into JSON text.

What does JSON.stringify() do in JavaScript?

JSON.stringify() — A method that converts a supported JavaScript value into JSON text.

const order = { item: "tea" };
const text = JSON.stringify(order);

Level: Journeyman · More JavaScript terms at this level

Updated