How to convert javascript object to JSON string using javascript with Example
3108 Views
JSON.stringify(JS Object)
JSON.stringify() method is used to convert java object to JSON string in Javascript.
Example
var userNames = new Array();
userNames.push("Raja");
userNames.push("Siva");
userNames.push("Kumar");
userNames.push("Sarathy");
document.write(JSON.stringify(userNames));