For those who code-golf, an unreliable test with fewest characters:
function isArray(a) {
return a.map;
}
This is commonly used when traversing/flattening a hierarchy:
function golf(a) {
return a.map?[].concat.apply([],a.map(golf)):a;
}
input: [1,2,[3,4,[5],6],[7,[8,[9]]]]
output: [1, 2, 3, 4, 5, 6, 7, 8, 9]