Knowledge Walls
John Peter
Pune, Maharashtra, India
How to convert javascript object to JSON string using javascript with Example
2232 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));
Demo & Output 
Best Lessons of "Good Javascript Examples"
Top lessons which are viewed more times.
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details