var a = [1,2,3];
When I try to call above function as below, return type is array
alert (typeof args1(1,2,3)); //array
alert (args1(1,2,3)); //1,2,3
alert (typeof args2(1,2,3)); //object
alert (args2(1,2,3)); //[object][object]
In both situations, function is expected to return array values. It is an array in first case but object in second case. Could anyone please explain on this? Why it is so?