]> source.dussan.org Git - jquery.git/commitdiff
Simplify the logic in $.type, thanks to jdalton for the suggesiton in 5d2be7e299131a3...
authorJohn Resig <jeresig@gmail.com>
Fri, 27 Aug 2010 14:03:30 +0000 (07:03 -0700)
committerJohn Resig <jeresig@gmail.com>
Fri, 27 Aug 2010 14:03:30 +0000 (07:03 -0700)
src/core.js

index 81a920b874e74fd2c395341c46e69bbbc5ab5fb7..d4a0e61bb7dc270e4d95cbb534f3b2e0540fa890 100644 (file)
@@ -446,10 +446,8 @@ jQuery.extend({
        },
 
        type: function( obj ) {
-               return obj === null ?
-                       "null" :
-                       obj === undefined ?
-                       "undefined" :
+               return obj == null ?
+                       String( obj ) :
                        toString.call(obj).slice(8, -1).toLowerCase();
        },