You can use typeof operator.
if( (typeof A === "object" || typeof A === 'function') && (A !== null) )
{
alert("A is object");
}
Note that because typeof new Number(1) === 'object'
while typeof Number(1) === 'number';
the first syntax should be avoided.