Permalink
Browse files

jQuery.type: clean up formatting, note error type added 1.9

  • Loading branch information...
1 parent 139441a commit cec60cb4e087499d4e1cc2f63af9b8634afca873 @kswedberg kswedberg committed Jan 18, 2013
Showing with 17 additions and 3 deletions.
  1. +17 −3 entries/jQuery.type.xml
View
@@ -12,10 +12,24 @@
<p>A number of techniques are used to determine the exact return value for an object. The [[Class]] is determined as follows:</p>
<ul>
<li>If the object is undefined or null, then "undefined" or "null" is returned accordingly.
- <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>
+ <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>
</li>
<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>)
- <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>
+ <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" // <strong>as of jQuery 1.9</strong></li>
+ <li>jQuery.type( /test/ ) === "regexp"</li>
+ </ul>
</li>
<li>Everything else returns "object" as its type.</li>
</ul>
@@ -27,4 +41,4 @@
</example>
<category slug="utilities"/>
<category slug="version/1.4.3"/>
-</entry>
+</entry>

0 comments on commit cec60cb

Please sign in to comment.