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-Url: http://git.asbjorn.it/?a=commitdiff_plain;ds=inline;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 81a920b..d4a0e61 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(); },