JSON.stringify() method

The Javascript handler JSON.stringify() method is used to transform a JSON object into a JSON string representation.

Syntax:

Json.stringify(value)

Parameters
value: It represents the value that has to be converted into a JSON string.

Return
JSON string.

Example:

<!DOCTYPE html>
<html>
<body>
<script>
var details = '{ "Name":"JAI", "Seat":"56", "Coach":"5A"}';
var passenger = JSON.stringify(details);
document.write(passenger);
</script>
</body>
</html>