This function returns the whole JSON array or the whole JSON object as string. The resulting string has the following characteristics:
- The properties of an object are sorted ascending by their name.
- The elements of an array are sorted ascending by their index.
- This string representation contains no whitespaces for formatting.