I am looking for a way to expose the type and methods of an unknown JavaScript object.
I am implementing third-party code that has limited documentation for their methods, so I do not have access to any documentation that would tell me what sort of object I should expect in response
.
Is there any way to ascertain what type of object this is and expose the methods it contains?
for (var i = 0; i <= response.length - 1; i++) {
console.log(response.i);
}
The output in the Firebug Console:
response: [object Object],[object Object],[object Object],....