anyObj=[{"test1":1, "test2":2}]; // from JS object to a JSON String jsonString = XSP.toJson(anyObj); // from JSON String to a JS object jsonObj = XSP.fromJson(jsonString); // jsonString : "[{"test1":1,"test2":2}]" // jsonObject: [Object { test1=1, test2=2}]