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 81a920b..d4a0e61 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();
        },