Custom Code service returns JSON Object in all respective SDKs as a root level object. You can append JSON array inside it and parse it on client side. However Custom code directly does not return JSON array. You can create a JSON string like this which will have JSON object on a root level however employeesArray mode will contain array inside.
{'"employeesArray":[
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
{"firstName":"Peter", "lastName":"Jones"}
] }
Let me know if it helps.
Thanks
Ajay