From: John Resig Date: Fri, 27 Aug 2010 14:03:30 +0000 (-0700) Subject: Simplify the logic in $.type, thanks to jdalton for the suggesiton in 5d2be7e299131a3... X-Git-Tag: 1.4.3rc1~135 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7f18d29287aad960fda58b29e3362c9323fc23db;p=jquery.git Simplify the logic in $.type, thanks to jdalton for the suggesiton in 5d2be7e299131a31cffbd73edea59cde30445608. --- diff --git a/src/core.js b/src/core.js index 81a920b87..d4a0e61bb 100644 --- a/src/core.js +++ b/src/core.js @@ -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(); },