File tree 1 file changed +17
-3
lines changed
1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change 12
12
<p >A number of techniques are used to determine the exact return value for an object. The [[Class]] is determined as follows:</p >
13
13
<ul >
14
14
<li >If the object is undefined or null, then "undefined" or "null" is returned accordingly.
15
- <ul ><li >jQuery.type(undefined) === "undefined"</li ><li >jQuery.type() === "undefined"</li ><li >jQuery.type(window.notDefined) === "undefined"</li ><li >jQuery.type(null) === "null"</li ></ul >
15
+ <ul >
16
+ <li >jQuery.type( undefined ) === "undefined"</li >
17
+ <li >jQuery.type() === "undefined"</li >
18
+ <li >jQuery.type( window.notDefined ) === "undefined"</li >
19
+ <li >jQuery.type( null ) === "null"</li >
20
+ </ul >
16
21
</li >
17
22
<li >If the object has an internal [[Class]] equivalent to one of the browser's built-in objects, the associated name is returned. (<a href =" http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robust-isarray/" >More details about this technique.</a >)
18
- <ul ><li >jQuery.type(true) === "boolean"</li ><li >jQuery.type(3) === "number"</li ><li >jQuery.type("test") === "string"</li ><li >jQuery.type(function(){}) === "function"</li ><li >jQuery.type([]) === "array"</li ><li >jQuery.type(new Date()) === "date"</li ><li >jQuery.type(new Error()) === "error"</li ><li >jQuery.type(/test/) === "regexp"</li ></ul >
23
+ <ul >
24
+ <li >jQuery.type( true ) === "boolean"</li >
25
+ <li >jQuery.type( 3 ) === "number"</li >
26
+ <li >jQuery.type( "test" ) === "string"</li >
27
+ <li >jQuery.type( function(){} ) === "function"</li >
28
+ <li >jQuery.type( [] ) === "array"</li >
29
+ <li >jQuery.type( new Date() ) === "date"</li >
30
+ <li >jQuery.type( new Error() ) === "error" // <strong >as of jQuery 1.9</strong ></li >
31
+ <li >jQuery.type( /test/ ) === "regexp"</li >
32
+ </ul >
19
33
</li >
20
34
<li >Everything else returns "object" as its type.</li >
21
35
</ul >
27
41
</example >
28
42
<category slug =" utilities" />
29
43
<category slug =" version/1.4.3" />
30
- </entry >
44
+ </entry >
You can’t perform that action at this time.
0 commit comments