Is there a good built-in way that I can find whether value is a array or not?
One simple check I can think of is as follows, but I don't like it:
if(ele.push){ /* its array it has push method */ }
I mean i would like know if something like pseudo-code below exists. typeof
doesn't seems to be applicable, as it only returns "object" (though that makes sense).
function x(ele){ if(isArray(ele)){ /* dosomething() */ } }