If I had an array of integers, like so: int array[] = {1,2,3,4,5};
How would I convert this array to JSON so that it is in this format
{ "array" : [ 1, 2, 3, 4, 5 ] }
I am not sure what’s best inside my Processing(Java) code.
The documentation is not clear to me as to how to do this.
https://processing.org/reference/JSONArray.html
https://processing.org/reference/JSONObject.html
If anyone can help, that’ll be most greatly appreciated.
Thanks