How do I convert a JSON array:
Example1:
[{"Name":"John","Surname":"Johnson"},{"Name":"Peter","Surname":"Johnson"}]
into:
Example2:
{"Table1":[{"Name":"John","Surname":"Johnson"}, {"Name":"Peter","Surname":"Johnson"}]}
I have instances where sometimes the values I work with is in an array, and sometimes not (is it just called an object? like in second example? or do I have terminology wrong?) So I need to just add the array into an object(?) in order to be able to use the same function for both Arrays (first example) and Objects with arrays(?)(Example2)
Yes. Also you can check if argument is an array inside your method.