From 7f18d29287aad960fda58b29e3362c9323fc23db Mon Sep 17 00:00:00 2001 From: John Resig Date: Fri, 27 Aug 2010 07:03:30 -0700 Subject: [PATCH] Simplify the logic in $.type, thanks to jdalton for the suggesiton in 5d2be7e299131a31cffbd73edea59cde30445608. --- src/core.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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(); }, -- 1.7.10.4