Added some tweaks to $.type to handle null and undefined. Added a bunch of unit tests...
[jquery.git] / src / core.js
index 5a00555..81a920b 100644 (file)
@@ -446,7 +446,11 @@ jQuery.extend({
        },
 
        type: function( obj ) {
-               return toString.call(obj).slice(8, -1).toLowerCase();
+               return obj === null ?
+                       "null" :
+                       obj === undefined ?
+                       "undefined" :
+                       toString.call(obj).slice(8, -1).toLowerCase();
        },
 
        isPlainObject: function( obj ) {