I need to know how to check the variable if its an Array or its an Object
var arr = ['foo', 'bar'];
var obj = {
0: 'foo',
1: 'bar'
}
document.write('arr is an: ' + typeof arr + ', obj is an: ' + typeof obj)
// The result is always:
// arr is an: object, obj is an: object
Is there any way to tell the difference between the two types?