
{"id":448,"date":"2023-08-25T17:22:40","date_gmt":"2023-08-25T17:22:40","guid":{"rendered":"\/\/api.jquery.com\/?p=448"},"modified":"2026-01-20T17:34:59","modified_gmt":"2026-01-20T17:34:59","slug":"jQuery.type","status":"publish","type":"post","link":"https:\/\/api.jquery.com\/jQuery.type\/","title":{"rendered":"jQuery.type()"},"content":{"rendered":"<article id=\"jQuery-type1\" class=\"entry method\"><h2 class=\"section-title\">\n<span class=\"name\">jQuery.type( obj )<\/span><span class=\"returns\">Returns: <a href=\"http:\/\/api.jquery.com\/Types\/#String\">String<\/a><\/span><span class=\"version-details\">version deprecated: <a href=\"\/category\/version\/3.3\/\">3.3<\/a>, removed: <a href=\"\/category\/version\/4.0\/\">4.0<\/a><\/span>\n<\/h2>\n<div class=\"entry-wrapper\">\n<p class=\"desc\"><strong>Description: <\/strong>Determine the internal JavaScript [[Class]] of an object.<\/p>\n<ul class=\"signatures\"><li class=\"signature\">\n<h4 class=\"name\">\n<span class=\"version-details\">version added: <a href=\"\/category\/version\/1.4.3\/\">1.4.3<\/a><\/span><a id=\"jQuery-type-obj\" href=\"#jQuery-type-obj\"><span class=\"icon-link\"><\/span>jQuery.type( obj )<\/a>\n<\/h4>\n<ul><li id=\"jQuery-type-obj-obj\">\n<div><strong>obj<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Anything\">Anything<\/a>\n<\/div>\n<div>Object to get the internal JavaScript [[Class]] of.<\/div>\n<\/li><\/ul>\n<\/li><\/ul>\n<div class=\"longdesc\" id=\"entry-longdesc\">\n    <div class=\"warning\">\n      <p>Note: This API has been deprecated in jQuery 3.3.<\/p>\n    <\/div>\n    <p>A number of techniques are used to determine the exact return value for an object. The [[Class]] is determined as follows:<\/p>\n    <ul>\n      <li>If the object is undefined or null, then \"undefined\" or \"null\" is returned accordingly.\n        <ul>\n          <li>jQuery.type( undefined ) === \"undefined\"<\/li>\n          <li>jQuery.type() === \"undefined\"<\/li>\n          <li>jQuery.type( window.notDefined ) === \"undefined\"<\/li>\n          <li>jQuery.type( null ) === \"null\"<\/li>\n        <\/ul>\n      <\/li>\n      <li>If the argument is either a primitive value or an instance of a standard built-in ECMAScript object, the [[Class]] internal property is used to determine the type. (<a href=\"http:\/\/perfectionkills.com\/instanceof-considered-harmful-or-how-to-write-a-robust-isarray\/\">More details about this technique.<\/a>)\n        <ul>\n          <li>jQuery.type( true ) === \"boolean\"<\/li>\n          <li>jQuery.type( new Boolean() ) === \"boolean\"<\/li>\n          <li>jQuery.type( 3 ) === \"number\"<\/li>\n          <li>jQuery.type( new Number( 3 ) ) === \"number\"<\/li>\n          <li>jQuery.type( \"test\" ) === \"string\"<\/li>\n          <li>jQuery.type( new String( \"test\" ) ) === \"string\"<\/li>\n          <li>jQuery.type( function() {} ) === \"function\"<\/li>\n          <li>jQuery.type( [] ) === \"array\"<\/li>\n          <li>jQuery.type( new Array() ) === \"array\"<\/li>\n          <li>jQuery.type( new Date() ) === \"date\"<\/li>\n          <li>jQuery.type( new Error() ) === \"error\" \/\/ <strong>as of jQuery 1.9<\/strong>\n<\/li>\n          <li>jQuery.type( Symbol() ) === \"symbol\" \/\/ <strong>as of jQuery 1.9<\/strong>\n<\/li>\n          <li>jQuery.type( Object( Symbol() ) ) === \"symbol\" \/\/ <strong>as of jQuery 1.12<\/strong>\n<\/li>\n          <li>jQuery.type( \/test\/ ) === \"regexp\"<\/li>\n        <\/ul>\n      <\/li>\n      <li>Everything else returns \"object\" as its type.<\/li>\n    <\/ul>\n  <\/div>\n<\/div><\/article>","protected":false},"excerpt":{"rendered":"<p>Determine the internal JavaScript [[Class]] of an object.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,61,76,91],"tags":[],"class_list":["post-448","post","type-post","status-publish","format-standard","hentry","category-deprecated-33","category-removed","category-utilities","category-91"],"_links":{"self":[{"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/posts\/448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/comments?post=448"}],"version-history":[{"count":5,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/posts\/448\/revisions"}],"predecessor-version":[{"id":1573,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/posts\/448\/revisions\/1573"}],"wp:attachment":[{"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/media?parent=448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/categories?post=448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/api.jquery.com\/wp-json\/wp\/v2\/tags?post=448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}