aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2010-08-27 07:03:30 -0700
committerJohn Resig <jeresig@gmail.com>2010-08-27 07:03:30 -0700
commit7f18d29287aad960fda58b29e3362c9323fc23db (patch)
tree0961e0064d7caaf547bc00f618b85b2e1b371505 /src
parent5d2be7e299131a31cffbd73edea59cde30445608 (diff)
downloadjquery-7f18d29287aad960fda58b29e3362c9323fc23db.tar.gz
jquery-7f18d29287aad960fda58b29e3362c9323fc23db.zip
Simplify the logic in $.type, thanks to jdalton for the suggesiton in 5d2be7e299131a31cffbd73edea59cde30445608.
Diffstat (limited to 'src')
-rw-r--r--src/core.js6
1 files changed, 2 insertions, 4 deletions
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();
},