See the question Javascript, check to see if a variable is an objectJavascript, check to see if a variable is an object but note that the accepted answer by Tom Ritter appears to be incomplete, check the comment on his answer. See also the community answer by Robcommunity answer by Rob.