<p>The output of my JSON call can either be an Array or a Hash. How do I distinguish between these two?</p>

Is object:
```
```
function isObject ( obj ) {
   return obj && (typeof obj  === "object");
}
```
```
Is array:
```
```
function isArray ( obj ) { 
  return isObject(obj) && (obj instanceof Array);
}
```
```
Because arrays are objects you'll want to test if a variable is an array first, and then if it is an object:
```
```
if (isArray(myObject)) {
   // do stuff for arrays
}
else if (isObject(myObject)) {
   // do stuff for objects
}
```
```