Articles → JavaScript → JSON.stringify function in JavaScript

JSON.stringify function in JavaScript






Purpose





Syntax


JSON.stringify(javascript_object);



Example


<!DOCTYPE html>
<html>
<head>
        <title></title>
        <script>
            var person= {};
            person.Name = "gyan";

            var string = JSON.stringify(person);

            document.write(string);
        </script>
</head>
<body>

</body>
</html>



Output



Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Monday, October 09, 2017

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250