JSON stringify
Convert a JavaScript object into a string with JSON.stringify().
samples:
const obj = {name: "John", age: 30, city: "New York"};
alert(typeof(obj));now its shows object
Use the JavaScript function JSON.stringify() to convert it into a string.
const myJSON = JSON.stringify(obj);
alert(typeof(myJSON));now its shows string