Fork me on GitHub Fork me on GitHub

stringify()


<%
	var myJson = {};
	myJson.name = "nuwan";
	myJson.company = "wso2";
	
	print(stringify(myJson));
%>

Overview

stringify() takes a well-formed JavaScript Object and returns the resulting JSON string.

var str = stringify(jsObject)


Parameters

Parameter Type Description
jsonObjObject
var jsonObj = {};
jsonObj.name = "nuwan";
jsonObj.company = "wso2";

A JSON Object

Return values

Value Type Description
jsonStringString
var jsonStr = stringify(jsonObj)
Stringified JSON object