The stringify() function of a JSON object accepts a JSON string, and constructs an object based on the given text and, returns it.
Syntax
Its Syntax is as follows
Json.stringify();
Example
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var jsonSample = '{Tutorial: Java, Version:8}';
jsonObj = JSON.stringify(jsonSample);
document.write(jsonObj);
</script>
</body>
</html>Output
"{Tutorial: Java, Version:8}"