I have a List returned to the jag. It is of type (java.util.List) and I need to print it as a json.
var storeForum = Packages.org.wso2.carbon.forum.registry.RegistryForumManager;
var forum = new storeForum();
var start = request.getParameter('start');
var count = request.getParameter('count');
var array =forum.fetchForumTopics(start,count, tenantDomainsArr, -1234, user.username);
forum.fetchForumTopics method returns
List<customOjbect>
How can I convert this List into a json format? I haven't been able to find any useful information on the internet about this.