Hello,
On my plugin, I have an array and I want to return it from a function as json to be able to load it into an array object and I want to do the same for a dictionary.
I've been trying for a while and can't make it work, anyone has a working example I can follow?
I do know it needs specific syntax (from google searching - I can;t seem to find this info on the documentation) but it still fails.
Code example that is failing:
Listinventory()
{
var width = 2;
var height = 1;
var c2ArrayData = ["cat","dog"]
var c2Array = '{"c2array":true,"size":[' + width + ',' + height + ',1],"data":'
+ JSON.stringify(c2ArrayData) + ",[],[]}";
return c2Array;
}
This returns: {"c2array":true,"size":[2,1,1],"data":["cat","dog"],[],[]} but I can't seem to load it into an array.