How to check response data is jsonObject or JsonArray

How to check response data is JsonObject or JsonArray?

i think this is bad API design.

To check whether an variable is an array or an object simply use javascript.

variable instanceof Array

or

if (variable.isArray) {
    return Array.isArray(variable);
}

I agree this is bad API design. The return type of each API call should be consistent.