This method is used to converts JavaScript objects into strings. When sending data to a web server the data should be like string.

BY Best Interview Question ON 13 Jan 2019

Example

// Stringify a JavaScript object
var nObj = { "fname":"best", "mname":"interview", "lname":"question"};
var myJSONData = JSON.stringify(nObj);
document.getElementById("MyID").innerHTML = myJSONData ;