Skip to content

Commit cec60cb

Browse files
committed
jQuery.type: clean up formatting, note error type added 1.9
1 parent 139441a commit cec60cb

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

entries/jQuery.type.xml

+17-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,24 @@
1212
<p>A number of techniques are used to determine the exact return value for an object. The [[Class]] is determined as follows:</p>
1313
<ul>
1414
<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>
1621
</li>
1722
<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>
1933
</li>
2034
<li>Everything else returns "object" as its type.</li>
2135
</ul>
@@ -27,4 +41,4 @@
2741
</example>
2842
<category slug="utilities"/>
2943
<category slug="version/1.4.3"/>
30-
</entry>
44+
</entry>

0 commit comments

Comments
 (0)